Custom Handler

Discussion in 'ASP.NET / ASP.NET Core' started by guitarchord, May 24, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I’m trying to get a custom handler to work on my live server with you guys but it doesn’t seem to work. The custom handler works fine in Visual Studio 2008 on my machine but when I upload it to my hosting space the handler page is never called.

    I did some research and it appears I may need to alter my web.config file to work with handler pages differently for IIS 7.0. I’ve read the below article and made changes according to what It says but still no luck!

    Here was the article provided by your guys forum:

    http://arcware.net/use-a-single-web-config-for-iis6-and-iis7/

    And this was the forum post:

    http://community.discountasp.net/showthread.php?t=7260&highlight=custom+httphandler

    Below is my web.config file, essentially it is just the default file when setting up a new site in Visual Studio 2008. All I’ve added was the 4 lines to point to my original handler for serving up MP3 files and now a test handler for capturing .JPG requests. The test handler does nothing to which I just put a debug in their to make sure it was getting called at runtime.

    Any help you can provide would be much appreciated as ive been hunting and playing around with this for over 4 hours straight now and still cant get it to work on my hosting space!

    Am I on the right track?

    Thanks
    Rob

    Please see attached word doc to view my web.config file.
     

    Attached Files:

    • Hi.zip
      File size:
      7.3 KB
      Views:
      300
  2. Customer Handler Headachee!!!!! sheeeesh!!!!!

    Are there any discountasp.net staff can help me out here???

    It's been several days and still no reply.

    I thought this would be a trivial matter ...

    I've researched a bit and discovered another guy had the same problem it was suggested that wild card script mappings needed to be added to his IIS configuration of his website in order for his Custom Handler to work.
    I've also saw that my site is hosted on a 2003 IIS 6.0 box not a 7.0 box like I had originally thought.

    Here's the link to the same problem:

    http://forums.asp.net/p/1325356/2646308.aspx#2646308

    Since i couldn't see any functionality to do this wild card script mapping thing im assuming i need to ask a discountasp.net person to do it for me?

    Can u guys add these script mappings for .MP3 so that my custom handler can serve up .MP3 files to my customers.

    Thanks!
    Rob
     
  3. Fixed!

    Ok, so after a long hit and miss I finally resolved the issue. It appeared that in fact my hosting account is on IIS 6.0 server and not IIS 7.0 as I originally thought. So playing around with <system.webserver> to enable my handler did absolutely nothing because it was never going to be called. In fact this whole section can be removed entirely!

    The problem was with Wildcard script mappings for custom extensions. I needed to create a separate entry in the application configuration section for my website!

    Discountasp.net why didn't u tell me this ... oh sorry Empire Strikes Back visions !

    Here's the link that I found from a guy with the same problem:

    http://forums.asp.net/p/1325356/2646308.aspx#2646308

    So for all intense and purposes VS2008 inbuilt IIS server creates these mappings automagically. Im guessing it looks at the web.config file and parses any extensions and does the mapping to aspnet_isapi.dll or wherever on the fly. But in production you have to do this yourself.

    Arrrgh but i dont have access to IIS Manager and can't enable these settings myself? Well you have to ask Discountasp.net support to do this for you. Just tell them your extension and which dll you want to map it to which for 99% of the time will be aspnet_isapi.dll and they will do it free of charge! :D
     
  4. Sorry Rob,
    I'm not sure how we missed your posting. But yeah on IIS 6 you will need to either set wild card mapping or tell us what extension to use the ASPNet ISAPI dll. In IIS 7 this is not a problem as calls in Integrated mode are run through the ASPNet ISAPI automatically.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page