Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 12, 2010 04:16 PM by N!cky
Member
90 Points
147 Posts
Sep 18, 2008 04:35 PM|LINK
maartenba Can you try putting the handler in the root of the website?
That didn't work either. I think it might have something to do with the Dependency Injection I'm using.
I'll keep looking. I'm determined to figure this out! [:)]
Thanks.
14 Points
4 Posts
Aug 07, 2009 12:46 AM|LINK
FYI:
I had this same problem and just solved it by adding an IgnoreRoute:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("Custom.sfx"); }
Provided classic/integration httpHandlers/handlers is setup properly and no authentication is blocking you it should be good to go.
42 Posts
Feb 12, 2010 04:16 PM|LINK
I was up against this problem last night, and here is how I solved it
I added this to my Global.asax file, before I defined my routes :
routes.IgnoreRoute("{filename}.ashx");
I added this to my <httpHandlers> node in my web config:
<add verb="*" path="*ImgHandler.ashx" type="AMSignsUI.Views.Shared.ImgHandler, AMSignsUI"/>
where : AMSignsUI.Views.Shared = the namespace in which I created the handler
and AMSignsUI = my application/project name
I added this to my <handlers> node in <system.webServer>
<add name="ImgHandler" path="*ImgHandler.ashx" verb="*" type="AMSignsUI.Views.Shared.ImgHandler, AMSignsUI"/>
Everything worked fine after I completed these steps. Note, the last step applies only if you are using IIS7
kahanu
Member
90 Points
147 Posts
Re: How to use a custom HttpHandler in MVC?
Sep 18, 2008 04:35 PM|LINK
That didn't work either. I think it might have something to do with the Dependency Injection I'm using.
I'll keep looking. I'm determined to figure this out! [:)]
Thanks.
MVC Central
http://www.mvccentral.net
ranaian
Member
14 Points
4 Posts
Re: How to use a custom HttpHandler in MVC?
Aug 07, 2009 12:46 AM|LINK
FYI:
I had this same problem and just solved it by adding an IgnoreRoute:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("Custom.sfx"); }Provided classic/integration httpHandlers/handlers is setup properly and no authentication is blocking you it should be good to go.
N!cky
Member
14 Points
42 Posts
Re: How to use a custom HttpHandler in MVC?
Feb 12, 2010 04:16 PM|LINK
I was up against this problem last night, and here is how I solved it
I added this to my Global.asax file, before I defined my routes :
routes.IgnoreRoute("{filename}.ashx");
I added this to my <httpHandlers> node in my web config:
<add verb="*" path="*ImgHandler.ashx" type="AMSignsUI.Views.Shared.ImgHandler, AMSignsUI"/>
where : AMSignsUI.Views.Shared = the namespace in which I created the handler
and AMSignsUI = my application/project name
I added this to my <handlers> node in <system.webServer>
<add name="ImgHandler" path="*ImgHandler.ashx" verb="*" type="AMSignsUI.Views.Shared.ImgHandler, AMSignsUI"/>
Everything worked fine after I completed these steps. Note, the last step applies only if you are using IIS7