This is neither a very common scenario nor a major finding, just a small reminder/warning to spare you a little debugging for one of those things that are fairly obvious yet could take some time to see.
While helping a friend figure out why his ASP.NET no longer works after "atlasising" it I came across this issue:
The page was throwing the following exception:
Script controls may not be registered before PreRender.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Script controls may not be registered before PreRender.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Script controls may not be registered before PreRender.]
Microsoft.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +144
Microsoft.Web.UI.UpdateProgress.OnPreRender(EventArgs e) +140
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
As the page worked before it had the atlas references and an update panel added (and out of laziness) instead of properly reading the source code I proffered to google the error and the only relevant result was http://forums.asp.net/thread/1471314.aspx where the suggestion was that an older version of the DLL might be cached somewhere. Here is where I went wrong and spent a lot of time clearing and rebuilding. On a second look, I found that the page's OnPreRender method was overridden and it didn't call the base OnPreRender method therefore loosing some handlers. Obviously this mistake didn't do much difference before atlas came into play but it did afterwards because the Atlas ScriptControlManager's RegisterScriptControl method doesn't register the control but after prerender (by checking a flag it sets on prerender)
public void RegisterScriptControl(TScriptControl scriptControl) where TScriptControl: Control, IScriptControl
{
if (scriptControl == null)
{
throw new ArgumentNullException("scriptControl");
}
if (!this._pagePreRenderRaised)
{
throw new InvalidOperationException(AtlasWeb.ScriptControlManager_RegisterScriptControlTooEarly);
}
this.ScriptControls.Add(scriptControl);
}
public void OnPagePreRender(object sender, EventArgs e)
{
this._pagePreRenderRaised = true;
}