(GO) ASP net MvC3 rendersection, Renderbody, Renderpage

Source: Internet
Author: User
Tags asp net

1.RenderBody

Renderbody can be understood as populating the contents of a layout page, typically in a _layout.cshtml file. Only one file can be in one. For example:

2.RenderPage

The fill content reads from a file through another page. For example:

_header.cshtml file:

@Html. Partial ("_header", model)--cshtml file name, required data (string Partialviewname,model)

3.RenderSection

You can have more than one @section in a page that defines a section in a file. For example:

Note:1> @RenderSection not add false, the page does not contain @section footer{}, will be error

Add false to indicate that the section is optional

2> @RenderSection ("footer") means that each page must be defined footer

Original link: http://blog.csdn.net/macaihong/article/details/6974179

(GO) ASP net MvC3 rendersection, Renderbody, Renderpage

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.