I have a number of .js files that I would like to be stored in the same directories as their views (they're specific to a view - its simply to keep the javascript separate from the view's HTML)
However, adding them to the /Views/ControllerName/
directory wont work because when a request is made to the webserver for the .js file:
<script type="text/javascript" src="/Views/ControllerName/myscript.js"></script>
It would essentially be directed at the 'Views' controller which obviously doesnt exist.
Update
From what I have read, adding the following IgnoreRoute in the global.asax.cs RegisterRoutes method should permit access to any requested .js file:
routes.IgnoreRoute("{resource}.js/{*pathInfo}");
However, I cant seem to get it to work?