Skip navigation.

Gordon Segal's Advice to An EntrepreneurAll recent postsCancelling Event Bubble Interferes With MS AJAX On Postback

Extender/Script controls may not be registered before PreRender

If you receive an error similar to this, it’s time to look for a missing call to base.OnPreRender.

If you override OnPreRender(EventArgs e) in a custom control, the conventional wisdom says you need to remember to call base.OnPreRender(e). Recently, I ran into this issue and found out the hard way that the page which hosts your control also must call base.OnPreRender in its OnPreRender (if you override it at all).

I hope I saved someone an hour or two of debugging. Thanks to Daniel Balla for pointing me in the right direction.

Comments

Comment permalink 1 Shree Menon |
Yes you did -- Thanks a lot....
Comment permalink 2 Willie Brits |
Thanks you did save me an hour or two
Comment permalink 3 Christoph |
Thanks. You did indeed save me some time.
Comment permalink 4 Chris N |
I'll add to the comments here... yes, that did save a lot of time and a lot of head-desk action...

Thanks!
Comment permalink 5 Pankaj Mittal |
Cool.. thanks.
Comment permalink 6 Stephanie |
Thank you for posting this.
Comment permalink 7 sunfly |
Could you help me ? I make a custom control which have a ScriptManager and a CalendarExtender .They were defined in the CreateChildControls.I didnot override OnPreRender. But I still had this
error(Extender controls may not be registered before PreRender.).
What's wrong?
I am sorry.I am a chinese.My english is bad.
Thanks.
Comment permalink 8 Irshaad |
sunfly,
have you managed to fix your problem?
I have the same problem and need a solution.

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

TrackBacks

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):