BT

InfoQ Homepage News Shared View Management for ASP.NET MVC

Shared View Management for ASP.NET MVC

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

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.