I have encountered the same problem recently, the above solution did not work for me. I hid the control and then made it visible in PreRender based on some kind of status check. Hiding worked fine, but when I made it visible again, it gave me the same error.
below What worked for me -
ScriptManager sm = ScriptManager.GetCurrent(Page); sm.RegisterScriptControl(control_name);
Then, so that managing the visible resolves my problem.
control_name.Visible = true;
Hope this helps someone who has run into this problem.
source share