Partial views of MVC (partial view)

Source: Internet
Author: User

Part of the view of MVC is indeed somewhat similar to the user controls of ASP.

The last time I practiced "MVC master Page _layout.cshtml" Http://www.cnblogs.com/insus/p/3380419.html learned the layout of the Web page pattern. This exercise is to make a partial view of the same part of the Web page, which can only maintain this partial view while maintaining it, without having to open the Web page of each phase to maintain it.

Let's take a look at the previous exercises, where the index.cshtml,details.cshtml and delete.cshtml views are quite similar, such as:





So we can make this Part a partial view, in the following real-time operation, because index.cshtml is a reference model, it is necessary to pass an entity parameter to the @html.partial () method.


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.