Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
Global.asax in asp.net in Tips of Asp.net/Ado.net/C#.net(Dotnet)
3413 Views
Introduction 
Global.asax is a file used to declare application-level events and objects. The Global.asax is an optional file ,we use it only when there is a need for it.
Global.asax
	public class Global : System.Web.HttpApplication
	    {
	        protected void Application_Start(object sender, EventArgs e)
	        {
	        }
	        protected void Session_Start(object sender, EventArgs e)
	        {
	        }
	         protected void Application_Error(object sender, EventArgs e)
	        {
	        }
	        protected void Session_End(object sender, EventArgs e)
	        {
	        }
	        protected void Application_End(object sender, EventArgs e)
	        {
	        }
	    }
Explanation of functions in global.asax 
    1) Application_Start() – fired when the first resource is requested from the web server and the web application starts.
 
    2) Session_Start() – fired when session starts on each new user requesting a page
 
    3) Application_Error() – fired when an error occurs.
 
    4) Session_End() – fired when the session of a user ends.
 
    5) Application_End() – fired when the web application ends.
 
    6) Application_Disposed() - fired when the web application is destroyed.
Best Lessons of "Asp.net/Ado.net/C#.net(Dotnet)"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details