I have a Main.cstml which is a normal view inside which I am rendering 2 partial views.
Code for Main.cshtml
@Html.Partial("Partial1")
@Html.Partial("Partial2")
Code for Partial1.cshtml
@model PartialViewDemo2.Models.Product
@using (Ajax.BeginForm("Partial1", "Home",
new AjaxOptions()))
{
@Html.TextAreaFor(m => m.Name)
<input type="submit" id="SubmitButton" />
}
Similarly there are some controls on Partial2.cshtml
Code on controller
[HttpPost]
public ActionResult Partial1(Product product)
{
return View(product);
}
When I click on submit button present on Partial1.cshtml, I want both the views to render, but only Partial1 gets rendered and Partial2 goes off.
I have represented my problem here using a very simple demo. Kindly help.