AJAX脚本管理器引起问题

3
我正在尝试在.NET 3.5中使用ScriptManager,但遇到了scriptmanager异常。我刚刚从页面中删除了所有的UpdatePanels,并将所有内容重构为UserControls,使页面不再像VB5应用程序一样编写。ToolkitScriptManager位于masterpage上,我已经尝试在受影响页面上使用或不使用ScriptManagerProxy。
我收到了以下错误的stacktrace:
“Controls集合无法修改,因为该控件包含代码块(即<%...%>)。 ”
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +8690071
   AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:323
   AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:305
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

我在代码中找不到任何<%=标签,现在感到绝望。我该如何追踪错误的源头。谢谢任何帮助。


1个回答

0
除了移除 <%= ..%> 之外,在代码后端(s)确保不要使用 Response.Write 输出任何内容。

谢谢。我确实检查了<%=,并且我没有使用Response.Write()。 - Echilon
这不是我的问题的原因。最近我一直在将.NET 3.5 Web应用程序转换为4.0,而我在这个特定的站点上留下了3.5版本的Ajax Toolkit。 - Echilon

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接