Jawad Khan

Jawad's Lodge - The willingness to torture yourself before others is what makes a developer truly a unique breed.
posts - 45, comments - 167, trackbacks - 148

My Links

News

Archives

Post Categories

Image Galleries

May 2005 Entries

How to Position the ASP.NET page to a particular vertical position on PostBack ...

In ASP.Net projects I have come across numerous time that you need to position the the page at certain vertical location on PostBack. For example you might have multiple long Panels or grids that when clicked need to post back the data to the server and return to certain other panel or Grid on the Page. SmartNavigation feature of ASP.Net allows you to keep the last click position on post back but does not allow the positioning of the page to any other desired location.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 25, 2005 11:21 PM | Feedback (27) |

Free Rich text Editor very useful for Community based ASp.Net Websites or Any ASP.Net website ...

Community Editor is web based WYSIWYG HTML editor. It enables ASP.Net Web developers to replace the Textarea in your existing/new Web Sites with a powerful, but easy to use WYSIWYG Editor. This rich editing tool empowers end users with an intuitive, easy-to-use interface for creating and publishing Posts/Forms without relying on any client-side components or controls.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 25, 2005 11:57 AM | Feedback (46) |

Adding, Updating, Invalidating , Setting Callback and Removing Data Cache in ASP.Net ....

ASP.Net has a very powerful Cache Management component. Cache is part of the most enterprise level .Net project. ASP.Net Data Cache is very flexible and is also available to Windows application by making use of HttpRuntime.Cache object. Microsoft provides a Cache Management Application Block but it can be overkill for lot of applications .....

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, May 23, 2005 10:08 PM | Feedback (4) |

MCMS 101 - How to Check if you are in Live Mode or if you are editing the Content of a Posting ....

Here we go again. One of the simplest but kind of hidden functionality is how to determine if the current posting is accessed in live mode or in the edit mode. Microsoft Content Management Server has several modes to display the page out of these three are the most prominent ones i.e. Published , UnPublished and Editing Mode. It is frequently asked that how you can display hint to the authors while they are Creating a new posting or editing an existing one ...

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 20, 2005 11:17 AM | Feedback (2) |

How to validate a valid GUID Value in C#

A Simple to use and efficient way of validating you GUID data type. Instead of trying to create an instance and catching the exception this implementation uses Regular Expression to validate a GUID.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 20, 2005 5:20 AM | Feedback (25) |

MCMS 101 - Getting/Searching list of Channels or Postings by Custom Property ....

Here is another article in the MCMS 101 series. This one deals with getting a list of all the Channels / Postings that contain a specific Customer Property. Remember that custom property should only be used for searches that are not very extensive and return a small set. If your have requirements of frequent searches on a Mets Information of a Channel(folder) or Posting(WebPage) then a better solution is to have a User Database linked to it. I will talk about it in my future Posts.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 18, 2005 4:35 PM | Feedback (6) |

Getting, Setting , Deleting and Updating Cookie Data as Collection in ASP.Net

Here is a helper class that makes it easy to do all the data manipulation functions on the data stored in the Cookie. It makes use of HybridDictionary Collection object and is very efficient for handling data in the Cookie.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 18, 2005 10:49 AM | Feedback (5) |

MCMS 101 - Automatically Approve all the Posting after copying or Making Bulk Changes to the Site

It is common to create multiple websites in a single instance of Microsoft Content Management server 2002 Server. Usually these sites share same site structure with different Content and different Skins. The simplest and efficient way to kick off a new site is to copy the child channels and posting after creating the Root channel for the New site.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 18, 2005 4:17 AM | Feedback (0) |

Calculating Cache Node Size for MCMS Site Administrators .. SQL Script

I am often asked what is the optimum value to put in the “Maximum Nodes in Memory Cache” setting in the Site Configuration Application Tab 2 named Cache in your Production environment. The idea is that the node cache is big enough to hold a 'copy' of all the nodes for your entire site, so the suggested size calculated from following script is the one to go for.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, May 17, 2005 1:39 PM | Feedback (3) |

SortedList that sorts By Value instead of Key ...

During my consultancy engagements I have come across numerous time when you need to sort the value displayed in the drop down box or in the the other Data bound control. It can be very frustrating to do that if you don't have much experience with .Net and you have to repeat similar code again and again. Well .Net 2.0 will ease it quite a bit with Generics ... For now here is a class that works exactly like sorted list but sorts the List by Value instead of Key ...

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, May 17, 2005 10:10 AM | Feedback (4) |

Creating Custom XML Placeholder Control ......

MCMS 2002 has a XML placeholder definition object but there is no XML placeholder Web Control shipped with the product. Woodgrove Sample MCMS website comes with a XML placeholder control but it real annoying in the sense that you only have 10 rows of text visible at a time. It is common requirement to customize the XML placeholder feel and look and also the functionality.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, May 16, 2005 8:47 PM | Feedback (4) |

MCMS 101 - Getting Content out of Placeholder ....

The most common functionality required in any MCMS project is to get access to the content contained in the placeholder. MCMS has different kind of placeholder definitions like HtmlPlaceholder, ImagePlaceholder, XmlPlaceholder and AttachmentPalceholder. It is desirable to get the content according to the type of placeholder for e.g in case of ImagePlaceholder you want the URL of the Image or some other properties rather then just a blog of string or HTML.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, May 15, 2005 5:04 PM | Feedback (1) |

Enabling Enter Key on a Text Box to auto click a Button ....

It is very Common practice to hit an enter key on a text box in order to submit a form. For example if you are designing a Login Screen it is frequently required that user just hit enter after filling in the password rather then to be forced to click on the login butto itself. ASP.Net by default will just post back the form without clicking the the specified button ..... Here is the code that you can call to tie your text box to desired button you want to get clicked .....

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, May 15, 2005 2:32 AM | Feedback (33) |

MCMS 101 - How to point your Local Site Manager to another Environment ....

One of the simple but very handy feature is to be able to have shortcuts on your desktop that can invoke site Manager that is pointing to Development, Content, Stagging and Production Environment.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, May 14, 2005 7:23 PM | Feedback (0) |

Code Conversion Tools ....
I have been asked many times to point to a utility that can convert the sample code or the code snippets found online from Visual basic.Net to C# and Vice versa. After lot of pain and relentless search i have come with following set of useful utilities. They still have their glitches but usually they bring correct result or very near to it. If you know better utlities just post it in the comments section. Thank you in advance .... To get the code converted to Visual Basic.NET from C# the following...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, May 14, 2005 12:38 PM | Feedback (1) |

Very Useful Free ASP.Net Custom Controls ...
I was looking for some reliable and useful Custom Control. In ASP.Net Projects it is very common to use Calendar Control or masked edit controls. The biggest challenge for our project was to find a Time Picker instead of Date Picker. Matt Hawley has great set of custom controls on his Excentrics World website. I am glad that I finally found it? In addition to a few standards (calendar, show/hide panel), he's added some very useful variations like a textbox that uses an input mask (see the phone number...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, May 14, 2005 11:53 AM | Feedback (29) |

Deployment Tool for ASP.Net Projects ....
For projects that do not require installation of assemblies in GAC you want a tool that can move your project to Production environment with out moving the unnecessary files like source code. Also some time the Project folder might have files that are not part of the Project. It is easier at times to moves the files in Zip format, FTP it or copy it directly to the target Server. Here is the tool that moves only the required files and you can select if you want to move the release version or th Debug...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 13, 2005 7:32 PM | Feedback (4) |

How to maintain a Microsoft Content Management Server database
I always get asked how to maintain MCMS database on Production Server. As the website is live for a while its normal to have some resources that are not linked any more or deleted copies of posting version etc. Here is the SQl Script and some Utlility code that will help you maintain your database. The Support article discusses general best practices for maintaining your Microsoft Content Management Server (MCMS) database by using tools that are included with the MCMS client tools and with SQL Enterprise...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 13, 2005 2:47 PM | Feedback (3) |

MCMS 101 ... How to get List of Child Channels Name and Url for Navigation control ...
I am working on a more complex class that will have an option to return deep Hierarchy and will have different options like get Hierierchy for only 2 level deep channels etc. Mean while I wanted to put the simplest solution to get the list with Display Name and Url for new comers to MCMS ...to keep it completely simple I am not including any Error handling which you should including your code ... For this example lets assume you have you left Navigation defined in SiteManager as follows Channel the...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 13, 2005 2:21 PM | Feedback (2) |

MCMS 101 - Quick Tutorial ...
I am planning to Post a set of posts here under the heading MCMS 101. During my consulting assignments and while conducting Microsoft Official Course for MCMS 2002 I have come across lot of requests for How to do commonly used functions in MCMS. The Guides usually make the things too complex. For example how to Create Navigation in MCMS. The guide will put the Navigation functionality in ASP.Net Custom control and put other plumbing code which make it much difficult to learn the real functionality....
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 13, 2005 11:11 AM | Feedback (6) |

Welcome !!!
I wanted to create a blog to share my experiences while creating Software with Microsoft and J2EE Technologies. In this Blog I will be posting some cool Tips and Tricks and new developments in ASP.Net, Microsoft Content Management Server, Sharepoint Portal Server and BizTalk Server. Here people can give me feedbank and put there comments as well. I have more then 10 years of experience in Software Development and Architecture. I have worked with Microsoft Consulting Services and Currently am employed...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 13, 2005 12:13 AM | Feedback (0) |

Invalidating ASP.Net Output Cache (Template) when new Content is Imported
Recently in a project I wanted to make sure that my ASP.Net Output Cache is cleared when I import new Content in to the Production Environment. After a little research I found it it's not that hard. In MCMS 2001 Microsoft used to have an API call called ServerCountChanged or something similiar. In MCMS 2002 there is no such call but there is an Event that we can hook into .... Microsoft.ContentManagement... This...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 12, 2005 10:49 PM | Feedback (0) |

How to Inavlidate User Control Cache Programatically....
Frequently you want to make sure that while Caching the User Control you have successfuly went through all the code paths in the code behind file. For e.g: you don't want to cache the User Control if there was an Error connecting to database that fills the DataGrif i.e. an empty resultset or worse an error is thown. What you really want is to try to regenerate the output on next request i.e Invalidate the Cache for current request. Whidbey will not have this issue and you could progamitically control...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 12, 2005 9:43 PM | Feedback (0) |

How to print only a Specific User Control or any Web Control from a WebForm ...

It is a frequent reuirement that you want to print a particular section of .aspx page or just a control like DataGrid with data populated. Usually the Javascript window.print will print the whole page that includes Navigation controls and other un desired items on the printed page. In order o solve this we need to render only the User control and print it but the caviar is that this page shuld not appear to the user.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 12, 2005 7:34 PM | Feedback (33) |

Powered by: