Note that there are some explanatory texts on larger screens.

plurals
  1. POissues with ajax form inside jquery UI popup in IE8
    text
    copied!<p>I was experimenting with jQuery UI and MVC3 and I stumbled upon the following issue:</p> <p>I have very basic page that uses AJAX </p> <pre><code>&lt;%: Ajax.ActionLink("Edit", "Edit", new { id = 1 }, new AjaxOptions() { UpdateTargetId = "dialog", OnSuccess = "DisplayPopup" }, null)%&gt; &lt;div id="dialog" title="Location"&gt; &lt;/div&gt; </code></pre> <p>This is the controller code:</p> <pre><code> public ActionResult Edit(int id) { return PartialView(); } [HttpPost] public ActionResult Edit() { return Content("Saved!"); } </code></pre> <p>and partial view edit:</p> <pre><code>&lt;b&gt;whatever&lt;/b&gt; &lt;% using (Ajax.BeginForm("Edit", "Home", new AjaxOptions() { UpdateTargetId = "editForm", HttpMethod = "POST" })) {%&gt; &lt;div id="editForm"&gt; &lt;input type="submit" value="Save" /&gt; &lt;/div&gt; &lt;% } %&gt; </code></pre> <p>the code above works fine.</p> <p>now I add the jquery UI popup code:</p> <pre><code>&lt;script type="text/javascript"&gt; function DisplayPopup() { $('#dialog').dialog('open'); } $('#dialog').dialog({ autoOpen: false, width: 600, modal: true, buttons: { "Close": function () { $(this).dialog("close"); } } }); &lt;/script&gt; </code></pre> <p>after that in Firefox and Chrome it works fine, whereas in IE8 I see the following issue:</p> <ol> <li>click edit - makes AJAX call to Edit(int id) action and shows the edit view inside a popup</li> <li>click save - makes AJAX call to Edit() and shows the text "Saved!"</li> <li>close the popup</li> <li>click edit - AJAX call to Edit(int id) - again</li> <li>click save - <strong>this time it makes FULL postback</strong> (only in IE)</li> </ol> <p>any ideas?</p> <p>Thanks!</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