tags:

views:

188

answers:

1

What is the best place (which folder, etc) to put view-specific javascript files in an ASP.NET MVC application?

To keep my project organized, I'd really love to be able to put them side-by-side with the view's .aspx files, but I haven't found a good way to reference them when doing that without exposing the ~/Views/Action/ folder structure. Is it really a bad thing to let details of that folder structure leak?

The alternative is to put them in the ~/Scripts or ~/Content folders, but is a minor irritation because now I have to worry about filename clashes. It's an irritation I can get over, though, if it is "the right thing."

+2  A: 

They can't be in the Views folder because the web server won't serve up anything but views from there. I suggest making subfolders under Scripts for specific named plugins, etc. to organize and keep them separate. Same with CSS -- I have mine in separate subfolders under Content/styles.

tvanfosson