I've refactored some of my View's javascript out into .js files alongside the views (not in the Scripts folder off root).
By default, the handler in web.config for the views stops these being loaded:
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
However, I want to override this to allow the browser to request .js files from this location.
Does anyone know how I can do this?
Thanks, Mark.
I think I would leave the scripts in the scripts location but if you wanted to move them you could do the following:
At the top of the web.config file under views look for
And replace it with the following:
You will need to add the extension of each file type you want to keep blocked.
You could change the path attribute there to be something less comprehensive than "*" (everything), but why are you fighting the conventions of the framework? The Views folder is intended to organize (only) the view files, and is specifically not meant to be accessed directly from the outside. Is there some reason why you can't put those script files elsewhere in your app?