You must Sign In to post a response.
  • Category: ASP.NET

    What is the use of global.asax?

    can we have more global.asax files
  • #756919
    This is use for doing global settings which apply to whole application. So developer can code once in global.asax file which required in all pages of that application.

    As per global requirement no need to use multiple global.asax file in same application.

    Regards & thanks
    Arvind kumar

  • #756921
    ofcourse we have setting the global also routing raise from this area then we have set Application.Start and Application end Whole application we can control from this area

    When you assign some session value from application start means assign here

    protected void Application_Start(object sender, EventArgs e)

    Session Start

    protected void Session_Start(object sender, EventArgs e)

    protected void Session_End(object sender, EventArgs e)

    protected void Application_End(object sender, EventArgs e)


    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #756922

    Global.asax is used for application level settings purpose. EX: Application start, Session Start , Session End, Application End... these event we are declared in global.asax then it's execute that first while running application.

    In an Application we can't able to set more than one global.asax file. We should use only one global.asax in an application.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #756943
    The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level and session-level events raised by ASP.NET or by HTTP modules

  • #756944

    its one of the application page where we get all Application level and session level Events .

    in this page, we can handle all errors in application level instead of page level error handling(like try, catch etc).

    in throughout application , we can add one and only one Global.asax file..

    the default envents are like:

    Session_start and session_End etc..

    hope u under stand, why we use this file..


  • Sign In to post your comments