IHttpModule Things I have noticed

Something I have learnt today whilst playing with is that when the Init method is called you shouldn't access the Context method the HttpAplication exposes because it seems like it is not fully constructed (things like the HttpMethod, QueryString and Form properties are not created).

However, if you handle an event like such:

context.BeginRequest += new EventHandler(Context_BeginRequest);

then once you enter the EventHandler, the Context Object (attached to the source parameter) seems to be fully constructed.

private void Context_BeginRequest(object sender, EventArgs e)
{
_context = ((HttpApplication)sender).Context;


Technorati Tags
[feed], [feed], [feed], [feed], [feed]

Related Wikipedia Documents
, , , ,

My Related Documents
, ,

Related Amazon Books
Build Your Own ASP.NET Website Using C# & VB.NET: /, ASP.NET Unleashed (Unleashed S.): /, Pro ASP.NET 2.0 in C#: /, Professional ASP.NET 2: /, Introducing ASP.NET 2.0: /, Beginning ASP.Net 1.1 E-Commerce: From Novice to Professional: /, Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries: /