locked
HttpModule Question (getting really weird results) RRS feed

  • Question

  • User763059395 posted
    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.
    Monday, February 9, 2004 10:14 PM

All replies

  • User-1391363652 posted
    Could you post some code from your HttpModule to see how you wire events?
    Tuesday, February 10, 2004 10:41 AM
  • User763059395 posted
    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 } ... }
    Tuesday, February 10, 2004 12:36 PM