My HttpModule is only executing on the first run of the application? What would cause this to happen? This is a module that I am using to Authenticate requests instead of a Global.asax. This is really baffling to me.
I found the problem. // my code class MyModule : IHttpModule { HttpContext Context; public void Init (HttpApplication application) {
Context = application.Context; .... } Applicaton_BeginRequest (...) { // use Context here } ... }
-- it should be -- // correct code class MyModule : IHttpModule { public void Init (HttpApplication application) { .... } Applicaton_BeginRequest (...) {
HttpContext Context = ((HttpApplication)sender).Context; // use Context here } ... }
Participant
792 Points
2233 Posts
HttpModule Question (getting really weird results)
Feb 09, 2004 10:14 PM|nberardi|LINK
Member
130 Points
293 Posts
Re: HttpModule Question (getting really weird results)
Feb 10, 2004 10:41 AM|MilanNegovan|LINK
http://www.AspNetResources.com
ASP.NET With Emphasis On Web Standards
Participant
792 Points
2233 Posts
Re: HttpModule Question (getting really weird results)
Feb 10, 2004 12:36 PM|nberardi|LINK
// my code class MyModule : IHttpModule { HttpContext Context; public void Init (HttpApplication application) { Context = application.Context; .... } Applicaton_BeginRequest (...) { // use Context here } ... }
-- it should be --// correct code class MyModule : IHttpModule { public void Init (HttpApplication application) { .... } Applicaton_BeginRequest (...) { HttpContext Context = ((HttpApplication)sender).Context; // use Context here } ... }