Question: I am using Ajax Comboboxes in my application. The controls are re-created dynamically on page\_load after postback. 

I keep receiving this error when selecting an item from the ajax combobox when I run the application.

> 
> Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Script controls may not be registered after PreRender.
> 
> 
> 

My Master\_Page...

```
<form runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" 
     runat="server" EnablePageMethods="True">
</asp:ToolkitScriptManager>

```

My content Page

```
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
    MyBase.OnPreRender(e)
End Sub

```

I had done the above methods based on other posts but it still does not resolve the issue. I must be missing something simple, I'm hoping so.
How can this error be resolved?

Answer: 
I found out if you are storing AJAX controls in Session or Cache and trying to recreate them on Page\_Load you will get the Script control error. FYI, storing Standard asp.net controls in session and recreating works fine.

Here are some links to help better understand the issues.
[Link 1] <http://forums.asp.net/t/1649461.aspx>
[Link 2] <http://www.telerik.com/community/forums/aspnet-ajax/docking/script-controls-may-not-be-registered-after-prerender.aspx>

If you are not using ajax controls there may be other reasons such as adding the script manager to the master page.
Try Page\_PreRender method instead of overriding OnPreRender method