在ASP.NET页面上添加AJAX控件后,不能调出窗口的解决办法:
ASP.NET2.0中AJAX使用新的ScriptManager 类来管理,而不兼容原来的 ClientScriptManager 类 ,所以用
alert('提示:产品添加成功!')和
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "name", "alert('提示:产品添加成功!');", true);
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "name", "alert('提示:产品添加成功');", true);
这些方法都是无效的.
可以用以下方法写代码实现
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('提示:产品添加成功!');if(confirm('是否继续添加?取消转到产品管理页')){alert('本页面继续添加')}else{window.open('productManage.aspx','_self');}", true);
ConfirmButtonExtender确认框
转载自:海涛(http://www.blogg.cn/1/viewspace-25231)
posted on 2007-09-03 13:36 火炏炎焱燚 阅读(1047) 评论(2) 编辑 收藏 引用