Place MVC content folder in scope

First of all, I understand that the default MVC 3 pattern Contentis optional css / img / etc. store folder.

I still like the concept of a folder Content, which should be a "reference" place to store images and stylesheets and other possible things (I also place all jQuery custom elements in subfolders Contentwith .js files in them).

I have not used MVC Areain my projects yet , since I did not have enough complicated. Now is the time.

And I'm thinking of placing a separate Contentfolder in each Area. Will this work? Is there something "bad" that can come from this? How can I not refer to the resources in it through ../Content/MyControl? Or is MVC Areajust like the root of a project, but separate?

+5
source share
1 answer

The area is almost like a separate project (but not quite). you can use

Url.Content("~/Areas/AreaName/Content/FileInfo");

or

<link type="text/css" src="RootOfSiteInfo/Areas/AreaName/Content/FileInfo"/>

There should not be any problems that cannot be available for static content, although I personally leave everything in the root folder of the content (a single storage point), since many times CSS and similar users are used in our projects in all areas.

+6
source

All Articles