Currently, the JqueryUI dialog box supports ease of use. The sample code is as follows:
Copy codeThe Code is as follows:
<Body>
<Form id = "form1" runat = "server">
<Div id = "dlg">
<Asp: TextBox ID = "TextBox1" runat = "server"> </asp: TextBox>
</Div>
<Asp: Button ID = "Showdlg" runat = "server" Text = "..."/>
</Form>
<Script type = "text/javascript" language = "javascript">
$ (Function (){
$ ("# Dlg"). dialog ({
AutoOpen: false,
Closed: true,
Width: 450,
Modal: true,
AppendTo: "form ",
Buttons :{
"OK": function (){
$ ("Form"). submit ();
},
"Cancle": function (){
$ (This). dialog ("close ");
}
},
Close: function (){
}
});
$ ("# <% = Showdlg. clientID %> "). button (). click (function () {$ ("# dlg "). dialog ("open"); return false });
}
);
</Script>
</Body>
It is worth noting that the appendTo: "form" option, JqueryUI Dialog will add the <div id = "dlg"> that represents the Dialog box to the Body by default, in this way, when the form is submitted, the server cannot obtain the server control-related values in the dialog box.