Geeks With Blogs
Lee Brandt's Blog You're only as smart as your last line of code

For those of you following the MVC releases, you will see something new in your File->New for MVC3 RC: _ViewStart.cshtml (_ViewStart.vbhtml for you VBers). This is a common place to dry out view dependencies. The most common view dependency is the MasterView it will use. To that end, the default _ViewStart page you get from a File->New MVC3 project has just the:

   1: @{
   2:     Layout = "~/Views/Shared/_Layout.cshtml";
   3: }

This seems to be done by convention. The view must be named “_viewstart.cshtml” or it will not be used. It also does not apply to partial views (since they are not really a page).

Hope this helps,


Posted on Saturday, November 13, 2010 2:51 PM MVC , Learning , Software , ASP.NET | Back to top

Comments on this post: MVC3 RC _ViewStart Page

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Lee Brandt | Powered by: