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 |
How you will manage the state of ASP.NET controls?
0 Answers Sans Pareil IT Services,
How should I destroy my objects in asp.net?
What describes a query?
What is the benefit of WebAPI over WCF?
can i call the java script to code behind file?if yes how?
How we can bind textbox,listbox and datagrid to sql server database in asp.net using visualstudio.net language (vb.net)?
Can you explain what inheritance is and an example of when you might use it?
What are the various authentication mechanisms in ASP.NET ?
1 Answers Digital GlobalSoft, Satyam,
Where does the Web page belong in the .NET Framework class hierarchy?
Explain the function of new view engine in asp.net? : asp.net mvc
what is diffrance between response.write & response.output.write
which event in global.asx that fires for every request of same user?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)