aspnet-404794-troubleshooting-server-side-issues-cannot-unregister-updatepanel.md
If you place ASP.NET AJAX UpdatePanel into a DevExpress container (such as ASPxSplitter, ASPxPopupControl, or ASPxPageControl), you can get the following exception during a container callback:
Cannot unregister UpdatePanel with ID {id} since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
The UpdatePanel is automatically registered in the ScriptManager in the panel’s Init event handler. Note that a panel is registered only once with the same identifier during a page life cycle. In the Unload event, the UpdatePanel is unregistered.
The issue occurs if the UpdatePanel is created dynamically or placed in a container whose child control hierarchy can be changed during the page life cycle. When the child control hierarchy is cleared and recreated, an old UpdatePanel clears its registration, but a new UpdatePanel with the same identifier is not registered again. An attempt to unregister the panel in the Unload event causes an exception.
You can use the following techniques to solve the issue:
You can replace an UpdatePanel with an ASPxCallbackPanel. Moreover, many DevExpress containers, such as an ASPxPopupControl or ASPxPageControl, have a built-in callback panel, so you do not need to add an UpdatePanel nor ASPxCallbackPanel to refresh their content.
Try the following recommendations that can be effective in certain scenarios:
EnableHierarchyRecreation property.EnableHierarchyRecreation property description for details.FindControl method in the page or control Init event.Load event.Important
This solution uses classes of the System.Reflection namespace that do not operate in Medium .NET Trust Level.
To solve the issue, register the UpdatePanel in the ScriptManager between two unregistered events.
Handle the UpdatePanel.Unload event.
In the event handler, register the UpdatePanel in the ScriptManager before the panel is unloaded.