If you've been reading in the Related
Articles you will know that HTTPModules can expose events and these
events can be handled in global.asax.
Here I'll just give you a quick module and
handler, but you will be able to see the advantages of it.
Here is our sample HTTPModule -
QuickModule : Implements
The bit from the web.config file -
As well as a bit from the global.asax file -
Response.Write("EVENT HANDLER TRIGGERED!!!")
I don't think that there is any need for a
demo here because the result is obvious. You can see that all we did to handle
it was to put -
object, e as EventArgs)
And ModuleName is the name that you
defined in web.config.
Well, that's Global.asax for you. As you can
see, it's a hell of a lot more powerful now than in Classic ASP and the fact
that you can now develop your own events to handle in there just makes it all
that more important and useful to your application. Check the Related
Articles for more information on HTTPModules if you haven't heard
of them before or want more information on them.