Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why not have the Scripts folder inside of the Content folder for ASP.NET MVC project?

Tags:

asp.net-mvc

Out curiosity I was wondering if there was a logical reason to have the Scripts folder not a sub folder of the Contents folder in an ASP.NET MVC project. The Contents folder typically contains your style sheets and images and for some reason it would seem natural to me to also include the Scripts folder in there as well.

like image 400
Blegger Avatar asked Feb 27 '09 19:02

Blegger


2 Answers

Possibly because scripts could be denoted as providing more functionality than style and design items, so it could be considered a portion of your business logic.

like image 146
TheTXI Avatar answered Nov 13 '22 02:11

TheTXI


The scripts and content folders are containers for client-side consumed files. They don't affect your MVC applications in any way. You can rename and move them around as you see fit, provided you update the URL references to them to point to the new path.

Having said that, I personally tend to rename these to js and css mostly because this makes my URLs shorter and easier to read and understand.

like image 41
Franci Penov Avatar answered Nov 13 '22 01:11

Franci Penov