HttpModule Attached to Pipeline Only Within Certain Folders RRS feed

  • Question

  • User2040230027 posted
    First off, thanks for taking the time to read my question.

    Is it possible to only attach certain HttpModules to the Pipeline when a request is made to some resource within a specific folder within my web application?  For example, say I have a customized role authorization module (and when I say customized I mean customized otherwise I'd be using the FormsAuthentication impl) that only attaches itself to the Application_AuthorizeRequest when accessing a resource within the "mywebapp/employee/" folder.  If I try to access a page such as "mywebapp/employee/default.aspx" I want my module attached to the pipeline.  Otherwise, when I try to visit some other resource outside that folder like "mywebapp/freebeer.aspx" I don't want that module firing off during the pipeline traversal.  Is this at all feasible or am I way off base.  During my preliminary research I could not find a definite answer and I would greatly appreciate any guidance regarding this issue.  Thanks again for reading.


    Wednesday, January 25, 2006 11:07 PM

All replies

  • User-1372641848 posted

    You have  access to current path (context.Request.Path) , You can write logic inside your module to behave differently for different paths.

    Friday, January 27, 2006 12:43 PM