I have modal popup containing partial view. this partial view is nothing but form. I have to update/refresh same modal popup with new partial view after Form submit, instead it reloads main page (refreshes browser) with that new view.
so I want all flow in same modal popup like - create employee---submit click---> create employee contact sequentially etc. here employee and employee contact are being used as partial view.
below is form -
@using (Html.BeginForm("EmployeeDetails", "Employee", new { source = string.IsNullOrEmpty(ViewBag.source)? "": @ViewBag.source }, FormMethod.Post, new { @class = "employee-details" }))
{
//submit button
}
below is post method -
public async Task<ActionResult> EmployeeDetails(EmployeeViewModel model, string source = "")
{
// save code
// after save, I have to return below view as partial view in same modal popup
return RedirectToAction("EmployeeContact", "Employee", new { employeeId = model.Employee.ID });
}
I also tried using PartialView syntax but that also behaving same (reload browser) -
return PartialView("~/Views/Employee/EmployeeContact.cshtml", new { employeeId = model.Employee.ID });
what I am missing?