How will you access the Application object value in a different page ?

 Posted by Akiii on 5/15/2012 | Category: ASP.NET Interview questions | Views: 1889 | Points: 40

Suppose :-

Application["Akiii"] = "This is the value";

To access the above application object global variable in a different object, we have to do the following :-

string strGlobal = Application["Akiii"].ToString();

In the above, it is essential to use ToString method to convert the value otherwise it will give an compilation error stating "An object cannot be casted to string".

Thanks and Regards

| Alert Moderator 

Comments or Responses

Login to post response