Author: SamU | Posted on: 2/7/2010 5:02:50 PM | Views : 354

I've implemented URL routing in my application and the URLHandler class I have for this particluar module will lookup the FolderID and place it in HttpContext.Items
On the page that user ends up with has the following code:

protected Int16 intFolderID { get { return Convert.ToInt16(HttpContext.Current.Items["intFolderID"]); } }
My question is this: what if there's an error and intFolderID does not get a value assigned to it. I'd like to at least instantiate it and give it a value of 0 so that I can do some validation. How do I assign a default value of 0 to this variable?

...

Go to the complete details ...