Html.partial,html.renderpartial html.action,html.renderaction Difference

Source: Internet
Author: User

@Html. Partial, @Html. renderpartial

The common denominator of both is to call another view in the view, the difference is that the html.partial has a return value (mvchtmlstring), use a variable to store the return value, or use @ to output directly.

And Html.renderpartial's return value is Void, his internal will automatically help us response output content, so can not be stored with variables, when used to @{html.renderpartial ();} to invoke

@Html. Action, @Html. Renderaction differences

The common denominator between the two is to request another action in the view, the same as above, Html.action has a return value (mvchtmlstring), use a variable to store the return value, or use @ to output directly.

And Html.renderaction's return value is Void, his internal will automatically help us response output content, so can not be stored with variables, when used to @{html.renderpartial ();} to invoke

As for, call these methods when the view inside the Viewstart is to see you   Return view (walk viewstart full view, if the viewstart.cshtml has the specified layout property, Then will also execute this layout page)   Return Partialview (do not go viewstart, direct access to the partial view), specific can also see here   http://www.cnblogs.com/ joeylee/p/3869633.html

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.