Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Describe paging in asp.net?

1137


What is a form tag?

864


Explain the role of global.asax?

971


What is session mode in asp.net?

1025


Explain what are delegates?

1090


What is session and cookies in asp.net?

1007


What r the asp.net list controls and diff. Between them?

957


Explain Optimization technique description?

1014


Why do we need master page in asp.net?

930


What is asp.net futures?

1076


what is publisher?

2092


Why does my asp.net file have multiple tag with runat=server?

979


How about the security in Activex DLL and Activex EXE ?

2255


How can i explain my project during interview?many time i expalain my project but they did't accept? please explain me.

5559


Explain how can we inherit a static variable?

1043