I\'ve got a UserControl that contains an UpdatePanel. When I put that on a page, it throws the following error:
Cannot unregister UpdatePanel with ID
In your markup, make sure you've specified an ID for both UpdatePanels and for every runat="server" control in their parent hierarchies.
I hope this helps someone else as it drove me nuts. After finding various tidbits of info here and there on here and elsewhere, I finally came up with the following fix. Note, I am not dynamically creating this update panel here or anywhere else and most info out there was related to creating this control dynamically, which I was not.
I was using an update panel inside a web user control used on a page inherited by a master page with the script manager. I don't know if this combo was what was causing it, but this is how I fixed it (inside the web user control where the update panel is utilized):
protected override void OnInit(EventArgs e)
{
ScriptManager sm = ScriptManager.GetCurrent(this.Page);
MethodInfo m = (
from methods in typeof(ScriptManager).GetMethods(
BindingFlags.NonPublic | BindingFlags.Instance
)
where methods.Name.Equals("System.Web.UI.IScriptManagerInternal.RegisterUpdatePanel")
select methods).First<MethodInfo>();
m.Invoke(sm, new object[] { updatePanel });
base.OnInit(e);
}