简体   繁体   English

AJAX SciptManager导致问题

[英]AJAX SciptManager causing problems

I'm trying to get a ScriptManager working in .NET 3.5 but getting a scriptmanager exception. 我试图让一个ScriptManager在.NET 3.5中工作,但是获得了一个scriptmanager例外。 I've just removed all of the UpdatePanels from the page and refactored everything into UserControls so the page is no longer written like a VB5 app. 我刚从页面中删除了所有UpdatePanel,并将所有内容重构为UserControls,因此页面不再像VB5应用程序那样编写。 The ToolkitScriptManager is on the masterpage, and I've tried with and without a ScriptManagerProxy on the offending page. ToolkitScriptManager位于主页面上,我在有问题的页面上尝试使用和不使用ScriptManagerProxy。

I get a stacktrace with the following error: 我得到一个堆栈跟踪,出现以下错误:

The Controls collection cannot be modified because the control contains code blocks (ie <% ... %>).

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

I can't see any <%= tags in the code and I'm getting desperate now. 我在代码中看不到任何<%=标签,现在我变得绝望了。 How would I go about tracing the source of the error. 我将如何跟踪错误的来源。 Any help is appreciated. 任何帮助表示赞赏。

除了删除和<%= ..%> ,请确保您没有Response.Write 。在代码隐藏中写入任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM