Hi,

I Dont know about Application and Session State management.
Can anyone explain me with simple example?



Hi, I Dont know about Application and Session State management. Can anyone explain me with simp..

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

Post New Answer

More ASP.NET Interview Questions

is it possible to access website from a remote place, without deploying it on web server?

1 Answers  


How to send auto matic emails based on scheduled tasks to several of my clients

6 Answers  


Types of objects in ASP ?

2 Answers   Microsoft,


What are runtime hosts?

2 Answers   Microsoft,


What is the difference between application state and caching?

0 Answers  






What is a ashx file?

0 Answers  


What is cookies in asp net?

0 Answers  


What is view state? where it stored? can we disable it ?

1 Answers  


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

2 Answers   PCS,


What is shared and private assembly?

1 Answers   Accenture,


Where the assembly is stored in asp.net?

0 Answers  


Can we create a multiple user simultaneously ?

0 Answers   MCN Solutions,


Categories