Sunday, November 1, 2020

Events in asp.net web page

In a web application, events can occur at 3 levels

1. At the application Level(Example: Application Start)

2. At the Page Level(Example: Page Load)

3. At the control Level(Example: Button Click)

ViewState variables are used to preserve data across page post back. By default, ViewState of one web form is not available in another webform.

Techniques to send data from one webform to another:
1. QueryString
2. Cookies 
3. Session State
4. Application State

Session state variables are available across all pages. but only for a given single session.
Session variables are like single-user global data. only the current session has across to its session state.

Application State variables are available across all pages and across all sessions.
Application State variables are like multi-user global data. All sessions can read and write Application State variables.


In ASP.NET web application, Global.asax file contains the application level events.
In general, Application events are used to initialize data that needs to be available to all the current sessions of the application. When as Session events are used to initialize data needs to be available only for a given individual session, but between multiple sessions.



After using the session and application state in global.asax file







No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...