Script controls may not be registered before PreRender

3 posts, 0 answers
  1. lisah
    lisah avatar
    4 posts
    Member since:
    Sep 2006

    Posted 24 Apr 2009 Link to this post

    Hello,

    I have recently migrated our website to ASP.Net 3.5 with RadControls for ASP.Net AJAX Q1 2008 (the last release we had access to).  Our site also is integrated to Community Server.

    In one portion of the site, there is an error in the interaction of the two packages, resulting in the error "Script controls may not be registered before PreRender".  The full trace follows at the end of this post.  The problem occurs when a radMenu is placed in a template as part of the community server skinning/templating system.

    The reproduction shows that the error does not occur when the menu is used outside of the template, and also does not occur when a ScriptManager element is used in the template without a menu.  The error occurs when the menu is used within the template.

    I have isolated the required Community Server components needed to reproduce the problem, and have created a small project that demonstrates the issue.  Please let me know where I can send the zip file of the solution.

    Thank you,

    Lisa Hakesley

    ------------------------

    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.]
       System.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +347825
       System.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +66
       Telerik.Web.UI.RadDataBoundControl.RegisterScriptControl() +29
       Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +22
       System.Web.UI.Control.PreRenderRecursiveInternal() +80
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Control.PreRenderRecursiveInternal() +171
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

     

    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

     

     

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 27 Apr 2009 Link to this post

    Hello lisah,

    You need to open a support ticket in order to attach files. You can refer to this forum post.

    Regards,
    Albert
    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.
  3. Dharmendra Baghel
    Dharmendra Baghel avatar
    1 posts
    Member since:
    Oct 2009

    Posted 27 Oct 2009 Link to this post

    [InvalidOperationException: Script controls may not be registered after PreRender.]
       System.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +269
       System.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +99
       Telerik.Web.UI.RadInputControl.RegisterScriptControl() +59
       Telerik.Web.UI.RadWebControl.ControlPreRender() +31
       Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +38
       Telerik.Web.UI.RadInputControl.OnPreRender(EventArgs e) +29
       System.Web.UI.Control.PreRenderRecursiveInternal() +86
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +2115833
       System.Web.UI.ControlCollection.Add(Control child) +146
       System.Web.UI.WebControls.RowControlCollection.Add(Control child) +34
       System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +33
       System.Web.UI.WebControls.RowControlCollection.AddAt(Int32 index, Control child) +40
       System.Web.UI.WebControls.TableRowCollection.Add(TableRow row) +27
       webform1.AddRow(Table tableid) in d:\dharmendra\RUN TIME CONTROL\webform1.aspx.cs:68
       webform1.Button2_Click(Object sender, EventArgs e) in d:\dharmendra\RUN TIME CONTROL\webform1.aspx.cs:106
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
    


    How can i solve it.
    Please help me.
Back to Top