只能将 ScriptManager 的一个实例添加到页面中
我有一个 ASP UpdatePanel 来更新 gridview,它工作得很好,现在我还想使用 AjaxControlToolkit 来处理其中的一些控件,但是在运行时连接所有内容后,
"Only one instance of a ScriptManager can be added to the page."
尽管我注释掉了 ASP,但 还是出现了错误ScriptManager 并正在使用工具包scriptmanager。但请注意,我仍在使用 ASP UpdatePanels。
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<!-- <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>-->
关于这里可能出什么问题有什么想法吗?
I had an ASP UpdatePanel to update a gridview which worked fine, now I wanted to also use AjaxControlToolkit for some of the controls in there, but after wiring up everything when I run I get an error
"Only one instance of a ScriptManager can be added to the page."
inspite of the fact that I commented off the ASP ScriptManager and am using the toolkitscriptmanager. however please note that I am still using the ASP UpdatePanels.
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<!-- <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>-->
Any ideas as to what might be going wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在使用 HTML 注释来隐藏 ASP.NET 服务器标记。请改用服务器注释:
ASP.NET 会忽略 HTML 注释,就像忽略所有没有 runat="server" 或不以
<%
开头的标记一样。You're using an HTML comment to hide an ASP.NET server tag. Use a server comment instead:
ASP.NET ignores HTML comments just like it ignores all tags without a runat="server" on them or that don't start with
<%
.原始错误消息告诉您,您尝试拥有多个 ScriptManger 对象。如果您在母版页和继承母版页的单个页面中使用
ScriptManager
,就会出现这种情况。为了避免这种情况,有
作为另一个ScriptManager
,尽管它只将调用传递给ScriptManager
对象母版页。The original error message tells you that you try to have multiple
ScriptManger
objects. Such a scenario would be present if you use aScriptManager
in the MasterPage and in a individual page that inherits the master page.To avoid this, there is
<Asp:ScriptManagerProxy>
which works as anotherScriptManager
, though it only passes the calls to theScriptManager
object in the masterpage.