Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery selectable causes full postback in ASP.NET Ajax application
    primarykey
    data
    text
    <p>I want my selectable to work as an autopostback control, when something is selected the script clicks on a button and postback the values of the selectable. But it doesnt play to well with my ASP.NET Ajax and UpdatePanels. Sometimes a full postback occurs, and not a partial one.</p> <p>My conclusions from my debugging is that jQuery does something behind the scene while the stop function runs. If I add an alert to halt the stop function, the partial postback works fine.</p> <p>To add some more confusion, this works in <code>IE9</code> and <code>Chrome</code>, but not in <code>IE7</code> or <code>IE8</code>. So it also might be browser specific.</p> <p>jQuery version is: v1.6.2</p> <h2>Script:</h2> <pre><code>&lt;script language="javascript"&gt; $('.selectable').live("mouseover", function () { if (!$(this).data("selectable-init")) { $(this).data("selectable-init", true); $(this).selectable({ filter: '.item', stop: function () { $("#&lt;% =btnPostback.ClientID %&gt;").click(); } }); } }); &lt;/script&gt; </code></pre> <h2>HTML:</h2> <pre><code>&lt;div class="selectable"&gt; &lt;div class="item"&gt;1&lt;/div&gt; &lt;div class="item"&gt;2&lt;/div&gt; &lt;div class="item"&gt;3&lt;/div&gt; &lt;div class="item"&gt;4&lt;/div&gt; &lt;/div&gt; &lt;asp:UpdatePanel runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:Literal ID="litIsPostback" runat="server"&gt;&lt;/asp:Literal&gt; &lt;asp:Button ID="btnPostback" runat="server" OnClick="btnPostback_OnClick" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <h2>Code behind:</h2> <pre><code>protected void btnPostback_OnClick(object sender, EventArgs e) { litIsPostback.Text = ScriptManager.GetCurrent(this).IsInAsyncPostBack.ToString(); } </code></pre>
    singulars
    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