Global.asax ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WJ

    Global.asax ?

    Is the "Application_St art" event on Global.asax created by the "very first
    user" who visits the Asp.Net web site ? Or is it started per user ? If it is
    the first case, how do you flush the global variables without shutting down
    the web site ?

    Thanks

    John


  • Marshal Antony

    #2
    Re: Global.asax ?

    Hi John,
    Application_OnS tart handler is executed only once in the lifetime of an
    application
    and not for every application instance.The application object is available
    in all pages or all modules of the
    application.You can add items to the Application object,For eg:
    Application["test1"]="Test 1";
    Once an item is added like this it is available to all pages or modules
    within the application.
    To remove the item added above,
    Application.Rem ove("test1");
    You can also use Clear or RemoveAll method to remove all items from a
    Application state.
    Application.Rem oveAll(); // this will remove all items from the application
    state.

    Hope this helps.
    Regards,
    Marshal Antony
    ..NET Developer



    "WJ" <JohnWebbs@HotM ail.Com> wrote in message
    news:unuVFkMLEH A.2624@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Is the "Application_St art" event on Global.asax created by the "very first
    > user" who visits the Asp.Net web site ? Or is it started per user ? If it[/color]
    is[color=blue]
    > the first case, how do you flush the global variables without shutting[/color]
    down[color=blue]
    > the web site ?
    >
    > Thanks
    >
    > John
    >
    >[/color]


    Comment

    • Ganesan Subramanian

      #3
      Re: Global.asax ?

      If you are using IIS5.0 with Windows 2000 server or older, in website
      properties, remove and create the "Applicatio n".
      If you are using Windows server 2003, stop and start the "Applicatio n Pool"
      for that website from IIS console.

      --
      Ganesan Subramanian
      Database and Datawarehousing .
      "WJ" <JohnWebbs@HotM ail.Com> wrote in message
      news:unuVFkMLEH A.2624@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Is the "Application_St art" event on Global.asax created by the "very first
      > user" who visits the Asp.Net web site ? Or is it started per user ? If it[/color]
      is[color=blue]
      > the first case, how do you flush the global variables without shutting[/color]
      down[color=blue]
      > the web site ?
      >
      > Thanks
      >
      > John
      >
      >[/color]


      Comment

      • Scott Allen

        #4
        Re: Global.asax ?

        The runtime only invokes Application_Sta rt once during the lifetime of
        the application.

        Can you tell us a bit more about your variables and what you need to
        do to flush them (reinitialize them?). It could be as easy as moving
        the initialization code into a different method in the Global class,
        and invoking that method when an event happens where you need to reset
        global state.

        There is an article here that has more information about the Global
        class and how it related to application state:


        HTH,

        --
        Scott

        On Tue, 27 Apr 2004 22:32:13 -0400, "WJ" <JohnWebbs@HotM ail.Com>
        wrote:
        [color=blue]
        >Is the "Application_St art" event on Global.asax created by the "very first
        >user" who visits the Asp.Net web site ? Or is it started per user ? If it is
        >the first case, how do you flush the global variables without shutting down
        >the web site ?
        >
        >Thanks
        >
        >John
        >[/color]

        --
        Scott

        Comment

        Working...