locked
New to HttpHandler, struggling with some file types. RRS feed

  • Question

  • User-762308593 posted

    So i'm trying for the first time to use the Httphandler and it starts off ok, but i'm hitting some issues. for starters I want all my .aspx pages to run through the handler: This works fine, my .aspx pages run through the handler.

    <add verb="*" path="*.aspx" type="myHandler"/> This works fine, my .aspx pages run through the handler.

    I've decided next that i want the handler to also catch situations such as www.mysite.com/adirectory . Nothing too special here, just creating that redirection of having what appears to be a directory but is actually not. I've implemented it as such:

    <add verb="*" path="*/*" type="JSFrontController.FormHandler"/>  This also is doing what i want, well appears to be.

    The problem is its catching everything now. If i simply try to link to a stylesheet on the page it fails and gives an error about buildproviders and stylesheets.  If it take the handler for directories out, stylesheets will work.  So i attempted to make it so stylesheets werent affected by this: 

    <add verb="*" path="*/StyleSheets/*" type="System.Web.UI.PageHandlerFactory" /> Well this does something entirely different. stylesheets dont give me an exception anymore, they just don't work.  I'm not sure where to go from here.

     

    Saturday, April 7, 2007 1:30 PM

Answers

  • User-1087479560 posted
    Hi,

    Please map css file to System.Web.DefaultHttpHandler rather than System.Web.UI.PageHandlerFactory. So that the file will be output verbatim.
    <add verb="*" path="*/StyleSheets/*" type="System.Web.DefaultHttpHandler" />

    Hope it helps.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 9, 2007 3:45 AM

All replies

  • User-1087479560 posted
    Hi,

    Please map css file to System.Web.DefaultHttpHandler rather than System.Web.UI.PageHandlerFactory. So that the file will be output verbatim.
    <add verb="*" path="*/StyleSheets/*" type="System.Web.DefaultHttpHandler" />

    Hope it helps.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 9, 2007 3:45 AM
  • User-762308593 posted
    thanks, that works like a charm.
    Monday, April 9, 2007 10:05 AM