脚本管理器创建问题 [英] script manager create problem

查看:66
本文介绍了脚本管理器创建问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All



i有两个scriptmanager的问题,点击更新按钮..



我有类似的代码





Hello All

i have problem for two scriptmanager while click update button..

I have Code Like that


ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "FixHeader();", true);





当我点击更新按钮警告消息弹出但我的修复头脚本nt设置为gridview





谢谢大家



while i click Update button alert message popup but my fixheader script nt set for gridview


Thank You All

推荐答案

只需用其他名称更改 showalert 参数即可。





Just change the showalert parameter with some other name and it will work.


ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert2", "FixHeader();", true);


1。我点击更新按钮时有两个scriptmanager的问题..

你不能在页面上有两个scriptmanagers。只有一个。



2.代码中的问题:
1. i have problem for two scriptmanager while click update button..
You cannot have two scriptmanagers on a page. Only one.

2. Issue in code:
ScriptManager.RegisterStartupScript(myPage, this.GetType(), "showalert", "alert('" + Message + "...!!');", true);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", "FixHeader();", true);



我看到你给两个脚本命名相同。这只是意味着您复制粘贴它并且不知道RegisterStartupScript的参数是什么。坏。

'' showalert '' - >有不同的名字。


I see you have given same name to two scripts. This simply means you copy-pasted it and have no idea what parameters are for RegisterStartupScript. Bad.
''showalert'' -> have different names.


这篇关于脚本管理器创建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆