HttpModule Not Firing

Last post 08-08-2008 1:15 AM by My Crystal. 3 replies.

Sort Posts:

  • HttpModule Not Firing

    08-03-2008, 1:02 AM
    • Member
      433 point Member
    • DMAR78
    • Member since 07-26-2006, 10:44 PM
    • Posts 71

    I have an HttpModule that I want to register in a child web.config (ie. not in the application level web.config). Now, the HttpModule works fine when it's in the application's root web.config.. but. if I put it in the web.config of one of the subdirectories.. it doesn't fire at all (ie the Init Method never fires).

    I looked in the MSDN documentation and it says thatte httpModules element can be configured at any web.config level.  If this is the case, what gives?

    ps. I haven't posted the code for the module because I've proven functionality, just not when I move it to the desired config level.

    Any thoughts?

     

    --D

    ** Remember to mark posts as the answer to help future users. **
    Visoft, Inc - Web Site | Blogs
  • Re: HttpModule Not Firing

    08-03-2008, 6:52 AM
    Answer
    • Star
      8,650 point Star
    • DavidKiff
    • Member since 12-07-2006, 11:07 PM
    • Hertfordshire, UK
    • Posts 1,733

    Im not sure you can add it at different levels!?  I would imagine you would add it at the root level and then look at the request to see if it should be run or not.. i.e check the RawUrl for the correct level?  What are you trying to do?

  • Re: HttpModule Not Firing

    08-04-2008, 1:14 PM
    Answer
    • Participant
      1,562 point Participant
    • Peter Bucher
    • Member since 07-16-2007, 2:23 PM
    • Switzerland
    • Posts 214
    • TrustedFriends-MVPs

    Hi there

    I agree with David.
    The Modules would only be activated if you are in that level where the config is applied, not above and below.

  • Re: HttpModule Not Firing

    08-08-2008, 1:15 AM
    Answer
    • Participant
      1,340 point Participant
    • My Crystal
    • Member since 06-08-2008, 10:09 AM
    • Guangzhou, China
    • Posts 334

    if registered in a child config file, I think(not sure) the module will fire when the page in the child folder is requested, it will not fire when other pages are requested.

    What really matters most is the chance to communicate with you, my friends, rather than marking my post as answer, though I would be really appreciated if you do so.

    ASP.NET 3.5 MCTS
Page 1 of 1 (4 items)