MVC3 branch view

Source: Internet
Author: User

 

This article only records the process of learning by yourself. If you are a Senior Programmer, please pass!

 

A small error was prompted when the Division view was first used.

 

Partial View call: <% = Html. Partial ("LossDetail", ViewData. Model) %>

 

You can also call it like this: <% Html. RenderPartial ("LossDetail", ViewData. Model); %> remember that there is a semicolon next to it.

 

Action error returned:

 

Return View ("segment View name ")

 

 

 

 

 

Return the branch View directly in the Action Return, so that the branch View is not displayed in the main View. It really makes me depressed, and I think my Return results are correct, why is it not displayed in the main view!

 

Return the correct Action:

 

Return View ("main View name ")

 

The reason is that I directly returned the branch view, which should be displayed in the main view. Remember that the branch view is called by the main view. In addition, the segment view can be separately displayed, but the corresponding Action of the segment view is required.

 

In this way, the effect I want is achieved. The Division view is useful in many ways.

From: column zhongshuling2009

Related Article

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.