HTTP Module attaching to Application_OnStart

G

Guest

We are creating an HTTP Module to add code to the Application On Start of an
applicaton. However, there is no HTTPApplication.OnStart event to attach to.

Does anyone know how to attach to this event? Oh, and while we are at it,
attach to the Session Start also.

Thanks,
 
G

Guest

Change the sub name from Application_OnStart to Application_Start. Then add
the HTTP module to the application in web.config. That's all.
 
G

Guest

Yes, I messed up on the Application_Start, but you cannot attach a delegate
to the Application Start it is not advertised in the HTTPApplication class.

Mike L.
 
S

Steven Cheng[MSFT]

Hi Mike,

the ASP.NET HttpModule is capable of synchorize most application events but
not all. As we can see such events as Application_Start, Application_End or
Restart is a application specific event rather than some other events (
Begin_Request, Authenticate_request) which are per-request specific. And
the following kb article as list all the available and supported events of
HttpModule:

#INFO: ASP.NET HTTP Modules and HTTP Handlers Overview
http://support.microsoft.com/default.aspx?scid=kb;en-us;307985

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

One of the questions asked that I was interested in is the Session_Start and
Session_End. These two events do not seem to be listed in the URL. When is
session "created" when is session id valid. I know that on Begin_Request the
session is not valid.

Kevin
 
S

Steven Cheng[MSFT]

Hi Kevin,

As for the Session management, we can found that the ASP.NET has some
buildin HttpModules registererd and each comming request will go through
those modules and one of them is called "SessionStateModule", you can also
find it in the machine.config's HttpModule section.
That's the one which does the most job for Session. Here is a tech article
in MSDN wihch also mentioned this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/aspnetsessionstate.asp

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top