If you want, you can use Ajax Helper MVCs and use Ajax.BeginForm () or use javascript and the standard post form. Whatever the choice, in action just return the idea.
If you use Ajax.BeginForm (), you can specify the element by its identifier for updating, and returning View will give you more control over what is returned compared to returning content.
@using (Ajax.BeginForm("MyActionHome", "Home", new AjaxOptions {HttpMethod = "POST", InsertionMode = InsertionMode.Replace, UpdateTargetId = "resultArea"}))
{
<input type="submit" name="Submit" value="Submit" /><
}
<div id="resultArea">
</div>
Action, Controller, Options , . TargetId, , "resultArea".
- , OnComplete JavaScript.
[HttpPost]
public ActionResult PurchaseUnit()
{
return View("_ResultPartial",);
}
, PartialView. Partial Id ,