Last active
April 3, 2016 17:30
-
-
Save casper-rasmussen/d4e35fec04197d17e99a7d1ac7ecac54 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model FormViewModel | |
@if (Model.Show) | |
{ | |
System.Web.Mvc.Ajax.AjaxOptions options = new AjaxOptions(); | |
options.HttpMethod = "POST"; | |
options.InsertionMode = InsertionMode.ReplaceWith; | |
options.UpdateTargetId = String.Format("form-{0}", Model.Form.Id); | |
options.Url = Model.ActionUrl; | |
<div id="@options.UpdateTargetId" > | |
@Html.ValidationSummary(false) | |
@using(Ajax.BeginXForm(Model.Form, options)) | |
{ | |
@Html.AntiForgeryToken() | |
Html.RenderXForm(Model.Form); | |
} | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment