我想獲得一個ScriptManager在.NET 3.5中工作,但得到一個scriptmanager異常。我剛剛從頁面中刪除了所有UpdatePanel,並將所有內容重構爲UserControls,因此該頁面不再像VB5應用程序那樣書寫。 ToolkitScriptManager位於主頁上,並且我在有問題的頁面上嘗試了使用和不使用ScriptManagerProxy。AJAX SciptManager導致問題
我出現以下錯誤堆棧跟蹤:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
堆棧跟蹤:
[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
我看不到代碼中的任何<%=標籤和我得到現在絕望了。我將如何去跟蹤錯誤的來源。任何幫助表示讚賞。
[「Controls集合無法修改,因爲該控件包含代碼塊」](http://stackoverflow.com/questions/778952/the-controls-collection-cannot-be-modified-because-the -control-contains-code-blo) – Mrchief