asp.net mvc - MVC Ajax.Beginform OnComplete/OnSuccess fired before controller call -
I am trying to clear an AJAX form when an item has been added to the database, but full and Onsewase is called AjaxOptions How can I get it before submitting a form so that the form is submitted first and is included in the reciprocal. Use of
& lt;% (Ajax.BeginForm ("AddTable", New AjaxOptions {UpdateTargetId = "Table", InsertionMode = InsertionMode.InsertAfter, OnComplete = "ClearForm ()"})) ) {%>
call
ClearForm () function {$ ('# DisplayName'). Val (''); }
However, the DisplayName text box is cleared before presenting the form to the left to the controller. There is no way around this.
hypothesis = "clean ()"
should be called without parentheses, That is, OnComplete = "ClearForm"
. I can not say for sure that this will fix your problem.
Comments
Post a Comment