Hi,
I Dont know about Application and Session State management.
Can anyone explain me with simple example?
Answer Posted / chandra prakash
Application state allows you to store global objects that can be accessed by any client. Application
state is based on the System.Web.HttpApplicationState class, which is provided in all web
pages through the built-in Application object.
Application state is similar to session state but the difference is that session state is user specific. It supports the same type of objects, retains
information on the server, and uses the same dictionary-based syntax. A common example
with application state is a global counter that tracks how many times an operation has been
performed by all the web application’s clients.
For example, you could create a Global.asax event handler that tracks how many sessions
have been created or how many requests have been received into the application. Or you can
use similar logic in the Page.Load event handler to track how many times a given page has
been requested by various clients. Here’s an example of the latter:
protected void Page_Load(Object sender, EventArgs e)
{
// Retrieve the current counter value.
int count = 0;
if (Application["HitCounterForOrderPage"] != null)
{
count = (int)Application["HitCounterForOrderPage"];
}
// Increment the counter.
count++;
// Store the current counter value.
Application["HitCounterForOrderPage"] = count;
lblCounter.Text = count.ToString();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What does session_start () do?
When Cookies are expired in ASP.NET?
What is the significance of proxy user?
What is boxing and unboxing in asp.net?
Can you explain composite pattern?
Describe a Windows Service and its lifecycle ?
WSDL means?
What is repository pattern in mvc.net? : asp.net mvc
What are web beacons used for?
Explain the concept of View Model in MVC?
What is an example of an application service provider?
How to implement role based security in asp.net mvc? : Asp.Net MVC
Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?
What are the new navigation controls in asp.net 2.0?
Where can I get the details on migration of existing projects using various technologies to asp.net?