@Styles. Render ("~/content/css")
@Scripts. Render ("~/bundles/modernizr")
@RenderSection ("header", Required:false) <!--sub-pages are inserted into the head entrance. Equivalent to ContentPlaceHolder in the master page---
@{html.renderaction ("Logininfo", "Partial");} <!--login information. Equivalent to a user control--
@{html.renderaction ("Navi", "Partial", new {Parentcontroller = viewcontext.routedata.values["Controller"]. ToString ()});} <!--navigation Bar. Equivalent to a user control--
@RenderBody () <!--output Nesting page-
@Html. Partial ("~/views/shared/_web_top.cshtml")
<script type="text/javascript"
src="@Url.Content("~/App_Themes/Scripts/Jquery/plugin/jquery.artDialog/artDialog.js?skin=icons")"></script>
<title>@ (Viewbag.title = = null?) "Site default title": Viewbag.title) </title>
<meta name= "Keywords" content= "@ (viewbag.keywords = = null?) "Site Default keyword": viewbag.keywords) "/>
<meta name= "Description" content= "@ (viewbag.description = = null?) "Site Default keyword": viewbag.description) "/>
<link href= "@Url. Content (" ~/content/css/product.css ")" rel= "stylesheet" type= "Text/css"/>
<link href= "@Url. Content (" ~/scripts/common/common.css ")" rel= "stylesheet" type= "Text/css"/>
<script type= "Text/javascript" src= "@Url. Content (" ~/scripts/jquery-1.6.2.min.js ")" ></script>
@RenderSection ("Head", Required:false)
Child master Page _singlecontent_layout.cshtml
@section header{@Styles. Render ("~/content/singlecontent") @* This is the entry for the child page of the book layout page to insert the content, notice? It writes in the book layout page insert the master page entrance *@ @RenderSection ("header", Required:false)}
@section Scripts {@RenderSection ("Scripts", Required:false)}
@{html.renderpartial ("_partialhander", new list<string> {"AAA", "BBB", "CCC"}); @* Call Distribution view, distribution view does not need to have controller*@
@model list<string> to the model type, the model is a collection of objects
@foreach (var item in Model) {
<li> @item </li>
}
@{html.renderpartial ("_partialfoot");}
Template page
<div>
@{html.renderpartial ("_partialhander", new list<string> {"AAA", "BBB", "CCC"}); @* Call Distribution View *@
</div>
<div>
@RenderBody ()
</div>
<div>
@{html.renderpartial ("_partialfoot");}
</div>
MVC notes-Template page layout