Application Level State Management is used to maintain the state of all the users accessing the web forms present within the website.
The value assigned for an application is considered as an object.
Application object will not have any default expiration period.
Whenever the webserver has been restarted or stopped then the information maintained by the application object will be lost.
If any data is stored on the application object then that information will be shared upon all the users accessing the webserver.
Since the information is shared among all the users, it is advisable to lock and unlock the application object as per requirement.
Global Application Class(Global.asax)
It is a Class which consists of event handlers which executes the code implicitly whenever a relevant task has been performed on the web server.Design:
- <%@ Application Language="C#" %>
- <script runat="server">
- void Application_Start(object sender, EventArgs e)
- {
-
- }
- void Application_End(object sender, EventArgs e)
- {
-
- }
- void Application_Error(object sender, EventArgs e)
- {
-
- }
- void Session_Start(object sender, EventArgs e)
- {
-
- }
- void Session_End(object sender, EventArgs e)
- {
-
- }
- </script>