Event sequence

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

    Event sequence

    You would think this list exists but I can’t find it anywhere. Is this the
    correct order for these events to be called?

    Global.asax Application_Sta rt (only once)
    Global.asax Application_Ini t (initialize for app here – can be called
    multiple times)

    BeginRequest
    AuthenticateReq uest
    PostAuthenticat eRequest
    AuthorizeReques t
    PostAuthorizeRe quest
    ResolveRequestC ache
    PostResolveRequ estCache
    After the PostResolveRequ estCache event and before the PostMapRequestH andler
    event, an event handler (a page corresponding to the request URL) is created.
    PostMapRequestH andler
    AcquireRequestS tate
    Global.asax Session_OnStart (if needed)
    PostAcquireRequ estState
    PreRequestHandl erExecute
    The event handler is executed.
    PostRequestHand lerExecute
    ReleaseRequestS tate
    PostReleaseRequ estState
    After the PostReleaseRequ estState event, response filters, if any, filter
    the output.
    UpdateRequestCa che
    PostUpdateReque stCache
    EndRequest (always called)

    Global.asax Session_OnEnd (on timeout – always after all of the above)

    Global.asax Application_Dis pose (called once for each Application_Ini t)
    Global.asax Application_End (only once)

    --
    thanks - dave
    david_at_windwa rd_dot_net
    Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


    Cubicle Wars - http://www.windwardreports.com/film.htm


  • Alvin Bruney [MVP]

    #2
    Re: Event sequence

    It is here: http://msdn2.microsoft.com/en-us/library/ms178472.aspx

    --
    _______________ _________
    Warm regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    Professional VSTO.NET - Wrox/Wiley
    The O.W.C. Black Book with .NET
    www.lulu.com/owc, Amazon
    Blog: http://www.msmvps.com/blogs/alvin
    -------------------------------------------------------


    "David Thielen" <thielen@nospam .nospamwrote in message
    news:02AF8254-1006-4F87-A0FA-901E4C81028A@mi crosoft.com...
    You would think this list exists but I can't find it anywhere. Is this the
    correct order for these events to be called?
    >
    Global.asax Application_Sta rt (only once)
    Global.asax Application_Ini t (initialize for app here - can be called
    multiple times)
    >
    BeginRequest
    AuthenticateReq uest
    PostAuthenticat eRequest
    AuthorizeReques t
    PostAuthorizeRe quest
    ResolveRequestC ache
    PostResolveRequ estCache
    After the PostResolveRequ estCache event and before the
    PostMapRequestH andler
    event, an event handler (a page corresponding to the request URL) is
    created.
    PostMapRequestH andler
    AcquireRequestS tate
    Global.asax Session_OnStart (if needed)
    PostAcquireRequ estState
    PreRequestHandl erExecute
    The event handler is executed.
    PostRequestHand lerExecute
    ReleaseRequestS tate
    PostReleaseRequ estState
    After the PostReleaseRequ estState event, response filters, if any, filter
    the output.
    UpdateRequestCa che
    PostUpdateReque stCache
    EndRequest (always called)
    >
    Global.asax Session_OnEnd (on timeout - always after all of the above)
    >
    Global.asax Application_Dis pose (called once for each Application_Ini t)
    Global.asax Application_End (only once)
    >
    --
    thanks - dave
    david_at_windwa rd_dot_net
    Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.

    >
    Cubicle Wars - http://www.windwardreports.com/film.htm
    >
    >

    Comment

    • bruce barker \(sqlwork.com\)

      #3
      Re: Event sequence



      will give a few more events to add to your list

      -- bruce (sqlwork.com)

      "David Thielen" <thielen@nospam .nospamwrote in message
      news:02AF8254-1006-4F87-A0FA-901E4C81028A@mi crosoft.com...
      You would think this list exists but I can't find it anywhere. Is this the
      correct order for these events to be called?
      >
      Global.asax Application_Sta rt (only once)
      Global.asax Application_Ini t (initialize for app here - can be called
      multiple times)
      >
      BeginRequest
      AuthenticateReq uest
      PostAuthenticat eRequest
      AuthorizeReques t
      PostAuthorizeRe quest
      ResolveRequestC ache
      PostResolveRequ estCache
      After the PostResolveRequ estCache event and before the
      PostMapRequestH andler
      event, an event handler (a page corresponding to the request URL) is
      created.
      PostMapRequestH andler
      AcquireRequestS tate
      Global.asax Session_OnStart (if needed)
      PostAcquireRequ estState
      PreRequestHandl erExecute
      The event handler is executed.
      PostRequestHand lerExecute
      ReleaseRequestS tate
      PostReleaseRequ estState
      After the PostReleaseRequ estState event, response filters, if any, filter
      the output.
      UpdateRequestCa che
      PostUpdateReque stCache
      EndRequest (always called)
      >
      Global.asax Session_OnEnd (on timeout - always after all of the above)
      >
      Global.asax Application_Dis pose (called once for each Application_Ini t)
      Global.asax Application_End (only once)
      >
      --
      thanks - dave
      david_at_windwa rd_dot_net
      Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.

      >
      Cubicle Wars - http://www.windwardreports.com/film.htm
      >
      >

      Comment

      • David Thielen

        #4
        Re: Event sequence

        That link seems to be for ASP.NET 3.0. It doesn't appear to list the actual
        events. Or am I missing something?

        --
        thanks - dave
        david_at_windwa rd_dot_net
        Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


        Cubicle Wars - http://www.windwardreports.com/film.htm




        "Alvin Bruney [MVP]" wrote:
        It is here: http://msdn2.microsoft.com/en-us/library/ms178472.aspx
        >
        --
        _______________ _________
        Warm regards,
        Alvin Bruney [MVP ASP.NET]
        >
        [Shameless Author plug]
        Professional VSTO.NET - Wrox/Wiley
        The O.W.C. Black Book with .NET
        www.lulu.com/owc, Amazon
        Blog: http://www.msmvps.com/blogs/alvin
        -------------------------------------------------------
        >
        >
        "David Thielen" <thielen@nospam .nospamwrote in message
        news:02AF8254-1006-4F87-A0FA-901E4C81028A@mi crosoft.com...
        You would think this list exists but I can't find it anywhere. Is this the
        correct order for these events to be called?

        Global.asax Application_Sta rt (only once)
        Global.asax Application_Ini t (initialize for app here - can be called
        multiple times)

        BeginRequest
        AuthenticateReq uest
        PostAuthenticat eRequest
        AuthorizeReques t
        PostAuthorizeRe quest
        ResolveRequestC ache
        PostResolveRequ estCache
        After the PostResolveRequ estCache event and before the
        PostMapRequestH andler
        event, an event handler (a page corresponding to the request URL) is
        created.
        PostMapRequestH andler
        AcquireRequestS tate
        Global.asax Session_OnStart (if needed)
        PostAcquireRequ estState
        PreRequestHandl erExecute
        The event handler is executed.
        PostRequestHand lerExecute
        ReleaseRequestS tate
        PostReleaseRequ estState
        After the PostReleaseRequ estState event, response filters, if any, filter
        the output.
        UpdateRequestCa che
        PostUpdateReque stCache
        EndRequest (always called)

        Global.asax Session_OnEnd (on timeout - always after all of the above)

        Global.asax Application_Dis pose (called once for each Application_Ini t)
        Global.asax Application_End (only once)

        --
        thanks - dave
        david_at_windwa rd_dot_net
        Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


        Cubicle Wars - http://www.windwardreports.com/film.htm
        >
        >
        >

        Comment

        • David Thielen

          #5
          Re: Event sequence

          That link has a totally different list of events as they happen. I assum that
          is what is happening under the covers but it is not events an app can get???

          --
          thanks - dave
          david_at_windwa rd_dot_net
          Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


          Cubicle Wars - http://www.windwardreports.com/film.htm




          "bruce barker (sqlwork.com)" wrote:

          >
          will give a few more events to add to your list
          >
          -- bruce (sqlwork.com)
          >
          "David Thielen" <thielen@nospam .nospamwrote in message
          news:02AF8254-1006-4F87-A0FA-901E4C81028A@mi crosoft.com...
          You would think this list exists but I can't find it anywhere. Is this the
          correct order for these events to be called?

          Global.asax Application_Sta rt (only once)
          Global.asax Application_Ini t (initialize for app here - can be called
          multiple times)

          BeginRequest
          AuthenticateReq uest
          PostAuthenticat eRequest
          AuthorizeReques t
          PostAuthorizeRe quest
          ResolveRequestC ache
          PostResolveRequ estCache
          After the PostResolveRequ estCache event and before the
          PostMapRequestH andler
          event, an event handler (a page corresponding to the request URL) is
          created.
          PostMapRequestH andler
          AcquireRequestS tate
          Global.asax Session_OnStart (if needed)
          PostAcquireRequ estState
          PreRequestHandl erExecute
          The event handler is executed.
          PostRequestHand lerExecute
          ReleaseRequestS tate
          PostReleaseRequ estState
          After the PostReleaseRequ estState event, response filters, if any, filter
          the output.
          UpdateRequestCa che
          PostUpdateReque stCache
          EndRequest (always called)

          Global.asax Session_OnEnd (on timeout - always after all of the above)

          Global.asax Application_Dis pose (called once for each Application_Ini t)
          Global.asax Application_End (only once)

          --
          thanks - dave
          david_at_windwa rd_dot_net
          Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


          Cubicle Wars - http://www.windwardreports.com/film.htm
          >
          >
          >

          Comment

          • Steven Cheng[MSFT]

            #6
            Re: Event sequence

            Hello Dave,

            The article Alvin mentioned describes the life cycle and events of ASP.NET
            page.

            The following one has detailed describes the application & pipeline level
            events and their fire sequence:

            #ASP.NET Application Life Cycle Overview


            Actually, Application_Sta rt and Application_End events are only fired once
            during the ASP.NET application's lifetime.


            The Application.Ini t and Dispose event are two event specific to each
            HttpApplication class(and our global.asax class which derive from
            HttApplication) . And for each ASP.NET request, there will has a dedicated
            HttpAppliction instance associated with it, so the "Init" and "Dispose"
            event fires once for each ASP.NET request.

            Also, for other events listed, they also fires once in each ASP.NET
            request, but they're more coupled with ASP.NET's server-side pipeline where
            we can do some customization on the request.

            Hope this helps. If there is anything unclear, please feel free to post
            here.

            Sincerely,

            Steven Cheng

            Microsoft MSDN Online Support Lead



            =============== =============== =============== =====

            Get notification to my posts through email? Please refer to
            Gain technical skills through documentation and training, earn certifications and connect with the community

            ications.



            Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
            where an initial response from the community or a Microsoft Support
            Engineer within 1 business day is acceptable. Please note that each follow
            up response may take approximately 2 business days as the support
            professional working with you may need further investigation to reach the
            most efficient resolution. The offering is not appropriate for situations
            that require urgent, real-time or phone-based interactions or complex
            project analysis and dump analysis issues. Issues of this nature are best
            handled working with a dedicated Microsoft Support Engineer by contacting
            Microsoft Customer Support Services (CSS) at
            http://msdn.microsoft.com/subscripti...t/default.aspx.

            =============== =============== =============== =====



            This posting is provided "AS IS" with no warranties, and confers no rights.

            Comment

            • David Thielen

              #7
              Re: Event sequence

              Hi;

              I may be missing it but I don't see in there where in the application events
              the Init, SessionStart, and Dispose are called. Yes they are only called the
              first/last time but if you need the Session object in an application event,
              you need to know when you can assume it exists.

              --
              thanks - dave
              david_at_windwa rd_dot_net
              Windward's document generation software provides a unique low-code solution that enables users to design custom, data-connected templates within the familiar landscape of Microsoft Office. Windward is fast, easy, and removes human error, transforming the way business professionals create documents.


              Cubicle Wars - http://www.windwardreports.com/film.htm




              "Steven Cheng[MSFT]" wrote:
              Hello Dave,
              >
              The article Alvin mentioned describes the life cycle and events of ASP.NET
              page.
              >
              The following one has detailed describes the application & pipeline level
              events and their fire sequence:
              >
              #ASP.NET Application Life Cycle Overview

              >
              Actually, Application_Sta rt and Application_End events are only fired once
              during the ASP.NET application's lifetime.
              >
              >
              The Application.Ini t and Dispose event are two event specific to each
              HttpApplication class(and our global.asax class which derive from
              HttApplication) . And for each ASP.NET request, there will has a dedicated
              HttpAppliction instance associated with it, so the "Init" and "Dispose"
              event fires once for each ASP.NET request.
              >
              Also, for other events listed, they also fires once in each ASP.NET
              request, but they're more coupled with ASP.NET's server-side pipeline where
              we can do some customization on the request.
              >
              Hope this helps. If there is anything unclear, please feel free to post
              here.
              >
              Sincerely,
              >
              Steven Cheng
              >
              Microsoft MSDN Online Support Lead
              >
              >
              >
              =============== =============== =============== =====
              >
              Get notification to my posts through email? Please refer to
              Gain technical skills through documentation and training, earn certifications and connect with the community

              ications.
              >
              >
              >
              Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
              where an initial response from the community or a Microsoft Support
              Engineer within 1 business day is acceptable. Please note that each follow
              up response may take approximately 2 business days as the support
              professional working with you may need further investigation to reach the
              most efficient resolution. The offering is not appropriate for situations
              that require urgent, real-time or phone-based interactions or complex
              project analysis and dump analysis issues. Issues of this nature are best
              handled working with a dedicated Microsoft Support Engineer by contacting
              Microsoft Customer Support Services (CSS) at
              http://msdn.microsoft.com/subscripti...t/default.aspx.
              >
              =============== =============== =============== =====
              >
              >
              >
              This posting is provided "AS IS" with no warranties, and confers no rights.
              >
              >

              Comment

              • Steven Cheng[MSFT]

                #8
                Re: Event sequence

                Thanks for Mark's informative input.

                Hi Dave,

                I think you don't need to care about the Init and dispolse event since
                they're specific to HttpApplication class's instance creation and
                termination rather than ASP.NET request lifecycle.

                As for Session's OnStart and OnEnd, certianly it won't occur in each
                requests and will fire depend on the current request's status. To further
                explain it, we should start from how SessionState management is implemented
                in ASP.NET, open the "web.config " in the framework folder, you'll find the
                SessionState management is done through the "SessionStateMo dule" httpmodule
                configured as below:


                ==============
                <httpModules>
                <add name="OutputCac he"
                type="System.We b.Caching.Outpu tCacheModule" />
                <add name="Session"
                type="System.We b.SessionState. SessionStateMod ule" />
                <add name="WindowsAu thentication"
                type="System.We b.Security.Wind owsAuthenticati onModule" />
                <add name="FormsAuth entication"
                type="System.We b.Security.Form sAuthentication Module" />
                ............... ....
                ............... ....
                </httpModules>
                =============== =


                In the module's processing methods, it will check session's status(from
                cookie or url string) and determine whether to create a new session or
                reset the current session's timeout window.... You can use reflector to
                insepect the methods of SessionStateMod ule for a thorough idea on how it
                works.

                Hope this helps some.



                Sincerely,

                Steven Cheng

                Microsoft MSDN Online Support Lead



                This posting is provided "AS IS" with no warranties, and confers no rights.


                Comment

                Working...