Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 8024 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > ASP.NET Interview Questions > How will you access the Application obje ...

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

Interview question and answer by: Akiii | Posted on: 5/15/2012 | Category: ASP.NET Interview questions | Views: 1057 | | Points: 40


Answer:

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
Akiii

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Akiii

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 3:51:19 PM