0

Can only seem to find articles that discuss using ashx files to implement a httphandler but I need to handle a reference to a particular js file - not the ashx. I have the HTTPHandler in place and my config file entry looks like this (the config in inetpub):

<add name="DeeMacsHandler" verb="*" path="filename.js" type="[ALL THE USUAL ASSEMBLY BITS]" />

But it's 404'ing. Is the use of an ashx file necessary in this case? Am I skipping a big step? Or is there some way I can intercept the call for this particular js file?

NOTE: This is to be deployed to a SharePoint web app (not sure if that's of any relevance).

Thanks a lot.

  • 2
    What version of IIS? What kind of 404 are you getting? – SLaks Sep 14 '12 at 13:56
  • 6.0. Webpage cannot be found - not sure of any other details I can give sorry. Thanks for your reply. –  Sep 14 '12 at 14:00

1 Answers1

1

You need to set IIS to run ASP.Net for .js files.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • @DeeMac: See http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx, which shows you how to map `.mvc` URLs to IIS. You need to do this whenever you want ASP.Net code to run for non-standard extensions. – SLaks Sep 14 '12 at 14:16
  • thanks a lot. I deleted my comment to be honest. You've answered the question so +1 and marked but I'm going to just opt for ashx files - the consumer can request ashx files just the same so it's not a problem. Thanks again. –  Sep 14 '12 at 14:17