使用scriptmanager.registerstartupscript

时间:2015-05-21 07:48:07

标签: javascript c# jquery asp.net

<asp:LinkButton ID="btnNotB" runat="server" OnCommand="showIds" ClientIDMode="Static">

protected void showIds(object sender, CommandEventArgs e)
{
....
ScriptManager.RegisterStartupScript(this, this.GetType(), "UniqueKey", "ShowAllIds();", true);
....
}

Javascript:

     <script type="text/javascript">
            function ShowAllIds() {
                $("#dialog").dialog({
                    autoOpen: false,
                    height: 'auto',
                    width: 'auto',
                    draggable: false,
                    resizable: false,
                    modal: true
                });
            }
  </script>

如何显示对话框?

1 个答案:

答案 0 :(得分:0)

您已设置autoOpen: false。从代码中删除它。

文档:http://api.jqueryui.com/dialog/#option-autoOpen