惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
C
Check Point Blog
I
InfoQ
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
月光博客
月光博客
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
Y
Y Combinator Blog
博客园 - Franky
博客园_首页
罗磊的独立博客
量子位
美团技术团队
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Martin Fowler
Martin Fowler
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏

博客园 - Kevin Wu

你是否也爱车 Asp..net 页面间跳转方法 Windows Server 2008 RC0正式发布、下载 通过Url抓取网页内容 如何生成静态页面的五种方案 (转)怎样用dos入侵局域网 闲里偷忙 [导入]学习网页制作: 用CSS来控制网页背景 为你的aspx页面加上ajax enable - Kevin Wu 几种保持页面状态信息的讨论(转) 在Windows Servrer 2003下安装UDDI服务和UDDI .NET SDK JDK1.5+Tomcat5+MySql+Juddi 架设UDDI服务器 拒绝了对对象 'xp_cmdshell'(数据库 'master',所有者 'dbo')的 EXECUTE 权限 解决方法 无法将类型“ASP.login_aspx”转换为“System.Web.UI.WebControls.Login” 错误处理 终于考完试了~~~ 远程控制(3) 远程控制(2) 关于windows hook的提问 远程控制(1)
(转)解决AJAX中使用UpdatePanel后再用Response.Write();等无...
Kevin Wu · 2007-06-06 · via 博客园 - Kevin Wu

在AJAX支持的网站中使用想使用Response.Wrie(“”); 或 Page. RegisterStartupScript (); 弹出一些提示对话框,没有效果。有如下两种解决方法:

(1)      System.Web.UI.ScriptManager.RegisterStartupScript来替代Page.ClientScript.RegisterStartupScript

函数原型:

System.Web.UI.ScriptManager.RegisterStartupScript(Contrl control, Type type,string key,string script, bool addScriptTags);

参数:

注:要多传一个Control参数,如果这个control在UpdatePanel里,则运行脚步,如果这个control不在UpdatePanel则不允许这段脚步

Eg.

System.Web.UI.ScriptManager.RegisterStartupScript(btnUnReport, this.GetType(), "unReport""alert('内容');window.close();"true);

 

(2)注册DataItem方法:

示例:

(3)      使用Javascript的非模态对话框弹出提示

Eg.

Page.RegisterStartupScript("alert""<script language='javascript'>window.showModelessDialog(\"javascript:alert('内容');window.close();\",\"\",\"status:no;resizable:no;help:no;dialogHeight:height:30px;dialogHeight:40px;\")</script>"); 

原文地址:http://blog.csdn.net/High_Mount/archive/2007/04/21/1573583.aspx,本文章对原文格式稍作了修改,内容没有变动,如有问题,请联系.