Something I have learnt today whilst playing with IHttpModule 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;
1 min read
IHttpModule Things I have noticed
Paul Kinlan
Lead of Chrome DevRel
See Also
Tags
Stay in the loop.
I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.