Note that there are some explanatory texts on larger screens.

plurals
  1. POError using Ajax.BeginForm when giving a callback parameter for OnSuccess, OnFailure, OnComplete and OnBegin
    primarykey
    data
    text
    <p>I'm trying to use an Ajax form, and whenever I provide a callback method to any of the AjaxOptions properties I get this error..</p> <blockquote> <p>Microsoft JScript runtime error: Object doesn't support this property or method</p> </blockquote> <p>If I do not provide a callback function to any of the properties (OnSuccess, OnFailure, OnComplete, or OnBegin) no error occurs and the form gets posted correctly.</p> <p>Here is my code.</p> <pre><code>&lt;% using (Ajax.BeginForm("someAction", "SomeController", new AjaxOptions() { HttpMethod="POST", UpdateTargetId = "feedbackMsg", OnSuccess = "ShowConfirmationMessage" })) { %&gt; </code></pre> <p>My javascript code is this.</p> <p><code>function ShowConfirmationMessage(xhr) { alert(xhr);} </code></p> <p>When I provide the OnSuccess method the code gets rendered like this. </p> <pre><code>&lt;form action="/Review/SaveQualityScore" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: &amp;#39;POST&amp;#39;, updateTargetId: &amp;#39;feedbackMsg&amp;#39;, onSuccess: Function.createDelegate(this, ShowConfirmationMessage) });" &gt; </code></pre> <p>I'm guessing the Function.createDelegate is the problem. Because when I remove the OnSuccess property the function.CreateDelegate doesn't get rendered and everything works fine.</p> <p>Anyways, I'm going crazy over here, any help would be appreciated. Thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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