Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Handling Application.Start via Custom HTTP Module

Reply
 
Old 04-23-2008   #1 (permalink)
Cramer


 
 

Handling Application.Start via Custom HTTP Module

Using ASP.NET 3.5: Can a custom HTTP Module be used to register for the
Application_Start event? Or _must_ I use Global.asax to work with
Application.Start?

I understand that I can use a custom HTTP Module to register for other
pipeline events (like Application.BeginRequest), but I was told that the
only place that I can set up an event handler for Application.Start is in
Global.asax.

My preference would be to register an HTTP Module in Web.config that, upon
its initialization, has logic that determines if Application.Start needs to
be handled, and if so, which class and method (that I load dynamically into
the application's default AppDomain) is to handle Application.Start.

So, ideally, things would go like this (please tell me if you see any
problems with doing things this way):
1. When the application is first started, a custom HTTP module is loaded
(per Web.config).

2. That custom HTTP module has logic that determines if Application.Start is
to be handled.

3. If runtime conditions dictate that Application.Start is to be handled,
then the HTTP module proceeds to load the correct assembly, instantiate the
correct class, and register the correct Application.Start event handling
method with the Application.Start event.

4. The Application.Start event is then raised, thereby invoking the event
handling method wired up in step 3 above.

For the above to work, I would have to rely on somethig that I don't quite
understand... and that is the sequence of activities that take place when an
ASP.NET application is started: in particular, I would need to be able to
count on my custom HTTP module being loaded *before* Application.Start is
raised. Can I count on that sequence?

Your feedback and comments are appreciated!




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Distribute Custom Visual Studio Module .NET General
Handling param statement in custom host application PowerShell
Custom Http Handler Factory and Possible Concurrency Issues on Application Start .NET General
I hate the handling by Vista of HTTP mail or lack thereof!!!! Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46