How can I render a partial view to be used in a JsonResult in a controller?
return Json(new
{
Html = this.RenderPartialView("_EditMovie", updatedMovie),
Message = message
}, JsonRequestBehavior.AllowGet);
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.
RenderPartialViewis a custom extension method which renders a view as astring.It wasn’t mentioned in the article (what you have referred originally) but you find it in the sample code attached to the article.
It can be found under the \Helpers\Reders.cs
Here is code of the method in question: