0

我想从 onClick 按钮后面的代码中打开对话框窗口。如何运行脚本?

 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <div id="dialog" title="Alert!!!" style="display: none;">
        <p>
            Lorem Ipsum
        </p>
    </div>

        private void InitializeComponent()
        {
            this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
            this.Load += new System.EventHandler(this.Page_Load);
        }

        private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "$(function() {$('#dialog').dialog('open');});", true);
        }
4

1 回答 1

1

尝试这个

ClientScript.RegisterClientScriptBlock(this.GetType(), "script", "<script> $('#dialog').dialog('open');return false;  </script>");
于 2013-03-26T14:17:11.380 回答