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

    What is the use of global.asax?

    Hiiiii,
    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
    Visit--blog.akumars.esoftera.in

  • #756921
    Hi
    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)
    {
    Session.Clear();
    }

    protected void Application_End(object sender, EventArgs e)
    {

    }

    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

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

  • #756922
    Hi,

    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.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #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
    Hi,

    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:

    Appllication_Start
    Application_End,
    Application_Error,
    Application_BeginRequest,
    Application_EndRequest
    Session_start and session_End etc..

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

    Thanks,
    Chitaranjan


  • Sign In to post your comments