MVC notes-Template page layout

Source: Internet
Author: User

@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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.