ASP.NET MVC - Where do you put your .js files if you dont want to store them in /Scripts?

Posted by Jimbo on Stack Overflow See other posts from Stack Overflow or by Jimbo
Published on 2010-05-19T12:22:49Z Indexed on 2010/05/19 12:30 UTC
Read the original article Hit count: 174

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.

Thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about JavaScript