Extender controls may not be registered after PreRender
I am creating Dynamic UserControls with Dynamic AjaxControls. Then I store each of the UserControls in a Collection. On Postback I recall the UserControls in the collection to Re-Create the interface. It works if i only use Standard HTML controls but does NOT work with AJAX controls. I get this error on PostBack Extender controls may not be registered after PreRender. So far I have tried the following:
- MyBase.OnPreRender(e) in Page and Usercontrol
- EnsureChildControls() in the OnInit
- Added ScriptManager to the MasterPage None of this stuff is working...
If I re-create all the controls including the ones inside the usercontrol then i get no error however it takes forever to do a postback as opposed to just recalling the collection of UserControls.
Stack Trace:
at System.Web.UI.ScriptControlManager.RegisterExtenderControl[TExtenderControl](TExtenderControl extenderControl, Control targetControl)
at System.Web.UI.ScriptManager.RegisterExtenderControl[TExtenderControl](TExtenderControl extenderControl, Control targetControl)
at System.Web.UI.ExtenderControl.RegisterWithScriptManager()
at System.Web.UI.ExtenderControl.OnPreRender(EventArgs e)
at AjaxControlToolkit.ExtenderControlBase.OnPreRender(EventArgs e) in d:\hg\act\Server\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:line 365
at AjaxControlToolkit.DropDownExtender.OnPreRender(EventArgs e) in d:\hg\act\Server\AjaxControlToolkit\DropDown\DropDownExtender.cs:line 157
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at 开发者_开发问答System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
精彩评论