ClientScriptManager cs = Page.ClientScript;
Type cstype = this.GetType();
String csname = "PopupScriptSuccess"; // Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname))
{
String cstext = "alert('成功添加记录。');if(confirm('是否打印发料单?')) window.open('print.aspx?id=" + insertedDeliveryID + "','_blank','fullscreen=0,menubar=no,location=no,scrollbars=auto,resizable=yes,status=yes');"
+"window.location.href=window.location.href";
cs.RegisterStartupScript(cstype, csname, cstext, true);
}.gettype方法我是看了很多例子了还是不明白!尤其是if (!cs.IsStartupScriptRegistered(cstype, csname))给重点解释下吧,
ClientScriptManager 这个东西跟.IsStartupScriptRegistered方法也不明白,哎,太笨了!
今天提问了N次了,没大有分了,还请见谅
Type cstype = this.GetType();
String csname = "PopupScriptSuccess"; // Check to see if the startup script is already registered.
if (!cs.IsStartupScriptRegistered(cstype, csname))
{
String cstext = "alert('成功添加记录。');if(confirm('是否打印发料单?')) window.open('print.aspx?id=" + insertedDeliveryID + "','_blank','fullscreen=0,menubar=no,location=no,scrollbars=auto,resizable=yes,status=yes');"
+"window.location.href=window.location.href";
cs.RegisterStartupScript(cstype, csname, cstext, true);
}.gettype方法我是看了很多例子了还是不明白!尤其是if (!cs.IsStartupScriptRegistered(cstype, csname))给重点解释下吧,
ClientScriptManager 这个东西跟.IsStartupScriptRegistered方法也不明白,哎,太笨了!
今天提问了N次了,没大有分了,还请见谅
解决方案 »
- ASP.NET 中关于MVC的一个很简单的问题(修改记录不成功)
- 如何给循环第一个加上样式
- 获取每一个访问者IP
- 〓〓〓问一个很弱智的问题,请大家多出点子。。。〓〓〓
- 高分求助:asp.net中如何 写 excel文件 (在线等)
- 2. 假设编写一个ASP.NET,使用动态表格生成技术,将存储Application对象或Cache对象中数据项的名字及其值显示在表格中。
- 请教:有谁用过 Lostinet.Janc的无刷新聊天室,怎么发布janc服务呢
- <asp:HyperLink>显示图片
- 关于隐藏页面控件button的问题
- 朋友的网站,大家提点建议
- 有关Irame里的一些鼠标事件问题..
- 求一个验证表达试
使用的方法是Page.ClientScript.RegisterStartupScript(Type type,string key,string script,bool addScriptTags)
type
要注册的启动脚本的类型。
key
要注册的启动脚本的键。
script
要注册的启动脚本文本。
addScriptTags
指示是否添加脚本标记的布尔值。