星空网 > 软件开发 > ASP.net

Page.ClientScript.RegisterStartupScript不执行问题

c#后台使用Page.ClientScript.RegisterStartupScript在前台注册一段脚本提示,发现没有效果,寻寻觅觅,终于从度娘处找到了原因:

该页面多次使用到了Page.ClientScript.RegisterStartupScript(Type type, string key, string script)

问题就出在了参数key上,同一页面会按顺序执行Page.ClientScript.RegisterStartupScript(Type type, string key, string script),如果key都为空或为相同的值,则会只执行第一个脚本,所以后面的就失效了。

Page.ClientScript.RegisterStartupScript(this.GetType(), "alertsuccess", "<script language='javascript'>SendSuccess();</script>");




原标题:Page.ClientScript.RegisterStartupScript不执行问题

关键词:ip

ip
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊站外推广怎么做?快速了解Techbargains Deals网站:https://www.ikjzd.com/articles/91159
必看:专门为Prime Day精修的图竟都不合格?答案在此!:https://www.ikjzd.com/articles/91161
在eBay独家拍卖的第16个年头,巴菲特今年的午餐会是什么价?:https://www.ikjzd.com/articles/91164
Amazon VS 独立站 shopify,跨境卖家该何去何从:https://www.ikjzd.com/articles/91165
紧急!中美贸易战之下美国收货人弃货,这3点必看!:https://www.ikjzd.com/articles/91170
亚马逊无货源店群是创业的机遇吗?:https://www.ikjzd.com/articles/91171
皇帝的皇宫=:https://www.vstour.cn/a/363188.html
海南岛琼海市旅游景点 琼海市的旅游景点:https://www.vstour.cn/a/363189.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流