Hi,
I Dont know about Application and Session State management.
Can anyone explain me with simple example?
Answer / 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 |
is it possible to access website from a remote place, without deploying it on web server?
How to send auto matic emails based on scheduled tasks to several of my clients
Types of objects in ASP ?
What are runtime hosts?
What is the difference between application state and caching?
What is a ashx file?
What is cookies in asp net?
What is view state? where it stored? can we disable it ?
When Garbage Collector runs in an Application? 1)Application is running form more than 30 min. 2)On every 1/4th milisecond 3) Randomly 4) Application is running on low of memory
What is shared and private assembly?
Where the assembly is stored in asp.net?
Can we create a multiple user simultaneously ?