BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Shared View Management for ASP.NET MVC

Shared View Management for ASP.NET MVC

This item in japanese

Bookmarks

Normally views in ASP.NET are organized by the controller that ‘owns’ them. If a view isn’t found in this location, then by convention the MVC runtime looks in the “Views\Shared”. This simple organization scheme works well for small projects, but can become quite unwieldy as the size of the web site grows and the shared folder becomes an ever larger dumping ground.

Michael Kennedy’s Enhanced View Locations project allows developers to tame the shared view folder. By referencing a small library (only 8KB) in their Application_Start event, developers can register as many additional folders as they see fit. It isn’t a perfect solution, sub-folders are not automatically included, but it is still preferable to seeing dozens or even hundreds of shared views in one massive folder.

 

Enhanced View Locations is offered via the MIT license. It is available on NuGet and instructions for its use can be found on Michael Kennedy’s blog.

Rate this Article

Adoption
Style

BT