Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I make my asp.net page postback when a control is clicked inside a jQuery dialog?
    text
    copied!<p>I'm having some trouble with jQuery UI. I've created a dialog with jQuery UI: so far, so good. I set up a form inside the jQuery UI dialog and then it's another story. I've written a very simple page to illustrate:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testpage.aspx.cs" Inherits="RiverCascade.testpage" %&gt; &lt;head runat="server"&gt; &lt;link rel="Stylesheet" type="text/css" href="Stylesheet1.css" /&gt; &lt;link rel="Stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.8.5.custom.css" /&gt; &lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function showModal() { $("#modalBox").dialog(); } $(document).ready(showModal); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Button runat="server" ID="button1" OnClick="button1_click" /&gt; &lt;div style="display:none" id="modalBox"&gt; &lt;asp:Button runat="server" ID="button2" OnClick="button2_click" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In the code above, see that I've just imported the jQuery, jQuery UI, and stylesheets and set up a page with a dialog box. There is an asp control button1 outside the dialog box and an asp control button2 inside the dialog box.</p> <p>When I click on button1, the event handler gets called and all is well. However, when on click on button2, the button inside the jQuery dialog, nothing happens.</p> <p>Why is my web page behaving this way? How can I fix it?</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