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
How to disable disable browser's Back button in asp.net (JavaScript)?
Define managed code and managed data in .net?
Explain advantages of caching?
How should I destroy my objects in asp.net?
What is inproc mode in session?
What are the Types of object in asp
Define page fragment caching?
Explain file-based dependency and key-based dependency.
What is marshalling ? Is it a part of asp.net ?
How can we call webservices in Banking Applications? and where we are using it?
Explain page output caching?
a web application needs to be created to accept the product name and quantity of a toy from a customer. After the customer has entered the product name the application needs to display the discounted price of the product to the customer (company is offering 35% discount on all products). The application should allow the customer to select the product name from a list box. and also while i'm data binding to a label with custom data binding with some declarations : "The Discounted Price is "+((System.Convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)) - ((System.convert.todouble(lblprodprice.text)*(system.convert.todouble(txtqty.text)*0.35)). Where i need to give this declaration in asp.net 2.0.
What are the two properties that are common on every validation control?
What is asp.net mvc? : asp.net mvc
What is the maximum number of classes that can be contained in one dll file?