Jquery ui dialog box instance code

Source: Internet
Author: User

Currently, the JqueryUI dialog box supports ease of use. The sample code is as follows:
Copy codeThe Code is as follows:
<Form id = "form1" runat = "server">

<Div id = "dlg">

<Asp: TextBox ID = "TextBox1" runat = "server"> </asp: TextBox>


<Asp: Button ID = "Showdlg" runat = "server" Text = "..."/>


<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 });





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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.