In ASP.NET MVC, what is the difference between:
Html.PartialandHtml.RenderPartialHtml.ActionandHtml.RenderAction
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Html.Partialreturns a String.Html.RenderPartialcallsWriteinternally and returnsvoid.The basic usage is:
In the snippet above, both calls will yield the same result.
While one can store the output of
Html.Partialin a variable or return it from a method, one cannot do this withHtml.RenderPartial.The result will be written to the
Responsestream during execution/evaluation.This also applies to
Html.ActionandHtml.RenderAction.