只能将脚本管理器的一个实例添加到页面 Ajax +泰勒里克
我正在尝试使用 Ajax 手风琴和 telerik RadScriptmanager 来拥有 AJAX 动态手风琴和拖放控件。这是我的 .aspx 中的内容,但我无法弄清楚如何使用这两个脚本管理器。谢谢!
<td width="29%" height="135">
<ajaxToolKit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="Server" />
<Scripts>
<ajaxToolkit:Accordion ID="NavigateAccordion" runat="server"
HeaderCssClass="accordionHeader"
ContentCssClass="accordionContent"
FadeTransitions="true"
SuppressHeaderPostbacks = "true"
AutoSize="None"
Width="220">
</ajaxToolkit:Accordion>
</td>
<td width="71%">
</td>
<form id="form2" runat="server">
<telerik:RadScriptManager ID="ScriptManager1" runat="server">
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Buttons" />
I'm trying to use Ajax accordion and the telerik RadScriptmanager to have an AJAX dynamic accordion and drag and drop control. This is what I have in my .aspx but i'm not able to figure out how to use both script managers. Thanks!
<td width="29%" height="135">
<ajaxToolKit:ToolkitScriptManager ID="ToolkitScriptManager2" runat="Server" />
<Scripts>
<ajaxToolkit:Accordion ID="NavigateAccordion" runat="server"
HeaderCssClass="accordionHeader"
ContentCssClass="accordionContent"
FadeTransitions="true"
SuppressHeaderPostbacks = "true"
AutoSize="None"
Width="220">
</ajaxToolkit:Accordion>
</td>
<td width="71%">
</td>
<form id="form2" runat="server">
<telerik:RadScriptManager ID="ScriptManager1" runat="server">
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Buttons" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不能同时使用这两个脚本管理器;由于两者都继承自
System.Web.UI.ScriptManager
,并且ScriptManager
只期望其自身的一个实例(内部定义),因此这种情况永远不会起作用。使用其中之一。您不需要有ToolkitScriptManager
即可让 AJAX 控件工具包正常工作;但是,脚本管理器必须位于页面顶部,位于其他 AJAX 控件之前。You can't use both script managers; since both inherit from
System.Web.UI.ScriptManager
, andScriptManager
expects only one instance of itself (defined internally), this scenario will never work. Use one or the other. You don't need to have anToolkitScriptManager
for the AJAX control toolkit to work; however, the script manager has to be at the top of the page, before the other AJAX controls.您的页面中只需要 1 个脚本管理器(最有可能在母版页中)。
然后,您希望使用内置的 ASP.NET Script Mananger 代理类从 Web 表单页面与其进行对话。
编辑:关于您的评论,我会考虑尝试将
块移动到ajax工具包脚本管理器中。
更多类似内容:
并删除 RadScriptManager 的使用
You only need 1 script manager in your page (most likely in a master page).
You then want to use the built in ASP.NET Script Mananger proxy classes to talk to it from a webform page.
Edit: Regarding your comment, I would look at just trying moving the
Block into the the ajax tool kit script manager.
More along these lines:
And remove the usage of the RadScriptManager