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 に答える