BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Shared View Management for ASP.NET MVC

| by Jonathan Allen Follow 7 Followers on Mar 08, 2012. Estimated reading time: less than one minute |

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 Stage
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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT