ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "error", "window.showModalDialog('Pop.aspx', 'newwindow', 'dialogWidth:400px;DialogHeight=300px;center: yes;help:no;resizable:no;status:no');", true);
//ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "error", "window.open ('Pop.aspx', 'newwindow', 'height=450, width=550, top=120,left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", true);
//ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('提示:产品添加成功!');if(confirm('是否继续添加?取消转到产品管理页')){alert('本页面继续添加')}else{open('productManage.aspx','_self');}", true);
//ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, UpdatePanel1.GetType(), "error", "window.open ('Pop.aspx', 'newwindow', 'height=450, width=550, top=120,left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');", true);
//ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('提示:产品添加成功!');if(confirm('是否继续添加?取消转到产品管理页')){alert('本页面继续添加')}else{open('productManage.aspx','_self');}", true);
aspx.CS 中:
第一种方法是用 showModalDialog 方法弹出模态窗口
第二种方法是用 window.open 弹出窗口
第三种方法是弹出窗口,不同的确认然后执行不同结果的示例
本文介绍了使用showModalDialog及window.open方法在ASP.NET中创建弹出窗口的三种方式。第一种采用showModalDialog实现模态窗口;第二种利用window.open打开新窗口;第三种展示如何依据用户确认操作执行不同逻辑。
2142

被折叠的 条评论
为什么被折叠?



