使用scriptmanager.registerstartupscript显示对话框
本文关键字:对话框 显示 registerstartupscript scriptmanager 使用 | 更新日期: 2023-09-27 17:50:22
<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>
如何显示对话框?
已设置"autoOpen: false
"。从你的代码中删除它
文档:http://api.jqueryui.com/dialog/option-autoOpen