section

@RenderSection("Header")

 


@section Header {
<div class="view">
@foreach (string str in new [] {"Home", "List", "Edit"}) {
@Html.ActionLink(str, str, null, new { style = "margin: 5px"
})

 

@RenderBody()==》@RenderSection("Body")==》@section Body

 


@if (IsSectionDefined("Footer")) {
@RenderSection("Footer")
} else {
<h4>This is the default footer</h4>
}

 

@RenderSection("scripts", false)             //如果不设定false,则必须提供相应的Section,否则抛出异常。

posted @ 2014-07-06 11:27  秋意了了  阅读(256)  评论(0编辑  收藏  举报