473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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_Start (only once)
Global.asax Application_Init (initialize for app here – can be called
multiple times)

BeginRequest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
After the PostResolveRequestCache event and before the PostMapRequestHandler
event, an event handler (a page corresponding to the request URL) is created.
PostMapRequestHandler
AcquireRequestState
Global.asax Session_OnStart (if needed)
PostAcquireRequestState
PreRequestHandlerExecute
The event handler is executed.
PostRequestHandlerExecute
ReleaseRequestState
PostReleaseRequestState
After the PostReleaseRequestState event, response filters, if any, filter
the output.
UpdateRequestCache
PostUpdateRequestCache
EndRequest (always called)

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

Global.asax Application_Dispose (called once for each Application_Init)
Global.asax Application_End (only once)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Nov 9 '06 #1
7 9352
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" <th*****@nospam.nospamwrote in message
news:02**********************************@microsof t.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_Start (only once)
Global.asax Application_Init (initialize for app here - can be called
multiple times)

BeginRequest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
After the PostResolveRequestCache event and before the
PostMapRequestHandler
event, an event handler (a page corresponding to the request URL) is
created.
PostMapRequestHandler
AcquireRequestState
Global.asax Session_OnStart (if needed)
PostAcquireRequestState
PreRequestHandlerExecute
The event handler is executed.
PostRequestHandlerExecute
ReleaseRequestState
PostReleaseRequestState
After the PostReleaseRequestState event, response filters, if any, filter
the output.
UpdateRequestCache
PostUpdateRequestCache
EndRequest (always called)

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

Global.asax Application_Dispose (called once for each Application_Init)
Global.asax Application_End (only once)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

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


Nov 9 '06 #2
http://msdn.microsoft.com/library/de.../Internals.asp

will give a few more events to add to your list

-- bruce (sqlwork.com)

"David Thielen" <th*****@nospam.nospamwrote in message
news:02**********************************@microsof t.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_Start (only once)
Global.asax Application_Init (initialize for app here - can be called
multiple times)

BeginRequest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
After the PostResolveRequestCache event and before the
PostMapRequestHandler
event, an event handler (a page corresponding to the request URL) is
created.
PostMapRequestHandler
AcquireRequestState
Global.asax Session_OnStart (if needed)
PostAcquireRequestState
PreRequestHandlerExecute
The event handler is executed.
PostRequestHandlerExecute
ReleaseRequestState
PostReleaseRequestState
After the PostReleaseRequestState event, response filters, if any, filter
the output.
UpdateRequestCache
PostUpdateRequestCache
EndRequest (always called)

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

Global.asax Application_Dispose (called once for each Application_Init)
Global.asax Application_End (only once)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

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


Nov 9 '06 #3
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_windward_dot_net
http://www.windwardreports.com

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" <th*****@nospam.nospamwrote in message
news:02**********************************@microsof t.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_Start (only once)
Global.asax Application_Init (initialize for app here - can be called
multiple times)

BeginRequest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
After the PostResolveRequestCache event and before the
PostMapRequestHandler
event, an event handler (a page corresponding to the request URL) is
created.
PostMapRequestHandler
AcquireRequestState
Global.asax Session_OnStart (if needed)
PostAcquireRequestState
PreRequestHandlerExecute
The event handler is executed.
PostRequestHandlerExecute
ReleaseRequestState
PostReleaseRequestState
After the PostReleaseRequestState event, response filters, if any, filter
the output.
UpdateRequestCache
PostUpdateRequestCache
EndRequest (always called)

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

Global.asax Application_Dispose (called once for each Application_Init)
Global.asax Application_End (only once)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

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


Nov 9 '06 #4
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_windward_dot_net
http://www.windwardreports.com

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


"bruce barker (sqlwork.com)" wrote:
http://msdn.microsoft.com/library/de.../Internals.asp

will give a few more events to add to your list

-- bruce (sqlwork.com)

"David Thielen" <th*****@nospam.nospamwrote in message
news:02**********************************@microsof t.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_Start (only once)
Global.asax Application_Init (initialize for app here - can be called
multiple times)

BeginRequest
AuthenticateRequest
PostAuthenticateRequest
AuthorizeRequest
PostAuthorizeRequest
ResolveRequestCache
PostResolveRequestCache
After the PostResolveRequestCache event and before the
PostMapRequestHandler
event, an event handler (a page corresponding to the request URL) is
created.
PostMapRequestHandler
AcquireRequestState
Global.asax Session_OnStart (if needed)
PostAcquireRequestState
PreRequestHandlerExecute
The event handler is executed.
PostRequestHandlerExecute
ReleaseRequestState
PostReleaseRequestState
After the PostReleaseRequestState event, response filters, if any, filter
the output.
UpdateRequestCache
PostUpdateRequestCache
EndRequest (always called)

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

Global.asax Application_Dispose (called once for each Application_Init)
Global.asax Application_End (only once)

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

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


Nov 9 '06 #5
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
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

Actually, Application_Start and Application_End events are only fired once
during the ASP.NET application's lifetime.
The Application.Init 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
http://msdn.microsoft.com/subscripti...ult.aspx#notif
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.

Nov 10 '06 #6
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_windward_dot_net
http://www.windwardreports.com

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
http://msdn2.microsoft.com/en-us/library/ms178473.aspx

Actually, Application_Start and Application_End events are only fired once
during the ASP.NET application's lifetime.
The Application.Init 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
http://msdn.microsoft.com/subscripti...ult.aspx#notif
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.

Nov 10 '06 #7
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 HttpApplicationclass'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 "SessionStateModule" httpmodule
configured as below:
==============
<httpModules>
<add name="OutputCache"
type="System.Web.Caching.OutputCacheModule" />
<add name="Session"
type="System.Web.SessionState.SessionStateModule" />
<add name="WindowsAuthentication"
type="System.Web.Security.WindowsAuthenticationMod ule" />
<add name="FormsAuthentication"
type="System.Web.Security.FormsAuthenticationModul e" />
...................
...................
</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 SessionStateModule 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.
Nov 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Banks | last post by:
I've got the following code as part of a C# web form but am having problems calling a command. I create a dataset and put some data on the screen. This works fine. (relevant sample below) ...
1
by: Fei Li | last post by:
I do not know if event handlers are called by the sequence of the subsription sequence.
0
by: Miquel | last post by:
Hi all. I felt frustrated when developing an 'UserControl' derivated from textBox, because sequence event (and Validate event) seems to fail. I Always thought my code was wrong. But after...
0
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
4
by: Charles Law | last post by:
Suppose a worker thread needs to signal to the main thread that an event has occurred. Ordinarily, any event raised by the worker thread will be on its own thread. How can the worker thread...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
12
by: markwalker84 | last post by:
Hi there, just wondering if i could have a pointer inthe right direction here... Sorry about the massive code posting - is that a wrong thing to do? from Initials import * import wx...
1
by: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
2
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
Which is the event sequence when a gridview button (for update) is clicked and the page is post back? I am also a bit confused when to use ..IsPostBack(). If my page data is changing maybe in every...
1
tlhintoq
by: tlhintoq | last post by:
I'm pretty sure this is language independent and is going to be the same whether it's VC or C# - but my project is C# WIndows Forms just in case. Does anyone have a good handle on the sequence of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.