Wednesday, September 10, 2008

Application State Variables

I wanted to make a quick note about Application State variables and Session State variables.

Application state variables must be initialized in Visaul C# before you perform most operations on them.

Example: You need to assign a value to the "Clicks" state variables before preforming any casting ....

Session["Clicks"] =(int)Session["Clicks"]+1;


If not done an error "Value null was found where an instance of an object was required" at run time.

No comments: