Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC Ajax.Begin form isn't posting back to actionresult
    text
    copied!<p>I have recently changed the below code from using a regular html 'form' to using an ajax.beginform, but it does not post back to the 'PostCheckListCompleted' actionresult. Any ideas why this is not working? </p> <pre><code> @Html.Grid(Model.ContactApplicationConditionList).RowAttributes(row =&gt; new Hash(@class =&gt; row.Item.IsSatisfied ? "completeRow" : "incompleteRow")).Columns(c =&gt; { c.For(a =&gt; string.Format("{0:dd/MM/yyyy}", a.DateRequested)).Named("Date Requested"); c.For(a =&gt; string.Format("{0:dd/MM/yyyy}", a.DateDeadline)).Named("Deadline Date"); c.For(a =&gt; string.Format("{0:dd/MM/yyyy}", a.DateReceived)).Named("Date Received"); c.For(a =&gt; a.Comment).Named("Comment"); c.For(a =&gt; a.ApplicationOfferCondition.Name).Named("Checklist type"); c.For(a =&gt; @Html.Raw(String.Format("&lt;a href=\"#?w=380\" onclick=\"$('body').data('contactApplicationConditionId', '{0}' );\" rel=\"checklistUpdatePopup\" class=\"popupWindow\"&gt;Update&lt;/a&gt;", a.ContactApplicationConditionId))).Named("Update"); c.Custom( @&lt;text&gt; @using (Ajax.BeginForm("PostCheckListCompleted", "Home", new AjaxOptions { HttpMethod = "Post" })) { @Html.CheckBox("checkListCompleted", item.IsSatisfied, new { onclick = "$(this).parent('form:first').submit();" }) &lt;input type="hidden" name="contactApplicationId" value=@ViewBag.ApplicationId /&gt; &lt;input type="hidden" name="contactApplicationConditionId" value="@item.ContactApplicationConditionId" /&gt; } &lt;/text&gt; ).Named("Complete"); }).Attributes(@cellpadding =&gt; "0", @cellspacing =&gt; "0", @class =&gt; "table_results") </code></pre> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload