Trent Stewart
Trent Stewart

Reputation: 881

MVC File Structure Standards

I am just new to MVC, we are building a massive system and have alot of namespacing in our site.

Where is the standard place to store files (CSS, Images, .JS) etc?

Would it be good to put them under the Content folder in sub-folders to their namespace or drop them in with their respective parent files or both.

Upvotes: 3

Views: 400

Answers (2)

Prashant Mehta
Prashant Mehta

Reputation: 482

Its better to put it in saparate folder as Script(js file) at root level. Add sub folder in content folder for Images and Css etc.

we can also create multiple controller and views for each section of your project. like for login section you can add Authentication Controller.

we can also use Helper class for adding general function and use it in every where.

you can see following link

http://msdn.microsoft.com/en-us/library/dd410120(v=vs.100).aspx

Upvotes: 1

Brian Mains
Brian Mains

Reputation: 50728

The default project structure includes a Content folder for CSS files and a Scripts folder for JavaScript files. A lot of people use this existing template, especially since a lot of Nuget projects may rely on this.

I personally like to put all of the content in a Content folder, and have a subfolder under this named Css and Scripts. It's really a matter of preference though. Do whatever is consistent and well-organized. That will be the key to making the application more easily maintainable.

Upvotes: 2

Related Questions