This is a migrated thread and some comments may be shown as answers.

[Solved] PreRender Error when loading dynamic controls

1 Answer 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 08 May 2009, 03:36 PM
I create a web form that will create any number of RadTextBoxes and RadComboBoxes based upon the results of a stored proc.  The initial load runs creating the controls, adds them to a placeholder and then the controls are added to a collection, then saved to a session object.  On post back, the session object repopulates the collection  and then the collection is loop thru to place the controls back on the page.  On the post back I am getting this error:  

Script controls may not be registered after 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 after PreRender.


Does anyone know how to fix this, has a work around or has a better solution to this?

Thanks.

Tim

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 May 2009, 06:14 AM
Hi Tim,

Is it possible that you are creating and using static events in your application?

If this is the case, please read the following blog post, which discusses the problem and its possible solutions.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Tim
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or