Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • yang 21 posts 33 karma points
    Apr 27, 2010 @ 15:56
    yang
    0

    How to register custom HttpHandler

    I created an HttpHandler in a class library project and directly inheriting from IHttpHandler. Added the "add" element into web.config and put the assembly for the handler into the bin folder. When I navigate to handler path Umbraco returns me the ugly(!) not found page. The handler works fine under a normal web site.

    Any ideas?

  • yang 21 posts 33 karma points
    Apr 27, 2010 @ 15:57
    yang
    0

    Also same thing happens for a custom aspx page.

  • Tobias Neugebauer 52 posts 93 karma points
    Apr 27, 2010 @ 16:12
    Tobias Neugebauer
    0

    Hi,

    you need to register your path or page (handler) in the web.config file under appSettings-> umbracoReservedUrls or umbracoReservedPath. Check out the pre defined values you shold get it done then :)

    Cheers

  • yang 21 posts 33 karma points
    Apr 27, 2010 @ 16:30
    yang
    0

    Hi Tobias,

    I think I acted a bit early :)

    This is what I do:

    I copy the assembly into the bin folder of umbraco. I add  <add verb="*" path="MyHandler.axd" type="MyAssembly.MyHandler, MyAssembly" /> to the web.config (Assembly name and the namespace is same in my case).

    I add ",/MyHandler.axd" to the umbracoReservedUrls setting.

    Now when I navigate to http://localhost/myhandler.axd I see the 404 page of IIS (not umbraco).

    Thanks for your help.

  • Tobias Neugebauer 52 posts 93 karma points
    Apr 27, 2010 @ 16:42
    Tobias Neugebauer
    0

    Hi,

    pleas try to rename the handler file to MyHandler.aspx in the reservedUrl and the handler declaration and try again.

    If that works your IIS has the .axd Files not registered.

  • yang 21 posts 33 karma points
    Apr 27, 2010 @ 16:46
    yang
    0

    Hi Tobias,

    Yes figured it out. axd is not registered, it works with the aspx extension.

    Thank you.

  • David Austin 2 posts 22 karma points
    Apr 19, 2013 @ 16:53
    David Austin
    0

    I am also trying to implement a custom httphandler and having no fun getting it to work.  I have a stand-alone web site on the same computer in which the handler works, but when I added it to Umbraco, no dice. It looks like this:

    Added to httpHandlers web.config section:

        
    Added to appSettings:
        
    The result is the asp default 404 not found page (not the umbraco-generated version).  I think this is a little different because it's mapping an ASPX extension.  I also added some mappings for the ASHX extension that are working just fine - just not the ASPX mapping.  Any advice on how to resolve this would be appreciated.
    Follow-up:  I got this work by upgrading to Umbraco 6 and adding the httpHandlers to the <handlers> section.
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies