PreRender Error with Custom list form

6 posts, 0 answers
  1. Henry
    Henry avatar
    8 posts
    Member since:
    Feb 2009

    Posted 08 Apr 2009 Link to this post

    I am trying to use Radeditor within a custom new item form. RadEditor works fine inside a list, but on a custom form I get the following error when the Radedtior tries to load:

    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) +236

       System.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +99

       Telerik.Web.UI.RadWebControl.RegisterScriptControl() +41

       Telerik.Web.UI.RadEditor.RegisterScriptControl() +24

       Telerik.Web.UI.RadEditor.OnPreRender(EventArgs e) +19

       Telerik.SharePoint.MOSSRadEditor.OnPreRender(EventArgs e) +38

       System.Web.UI.Control.PreRenderRecursiveInternal() +86

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Control.PreRenderRecursiveInternal() +170

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041

  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 09 Apr 2009 Link to this post

    Hello Henry,

    In order to fix this error you need to add a reference of a Script Manager to the current Master Page (default.master).

    Add to the top of the Master Page:
    <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" Namespace="System.Web.UI" TagPrefix="asp" %> 


    Add <asp:Scriptmanager/> in the master page:
    <asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager> 

    Also make sure that you have the following code in your <SharePoint>/<SafeControls> section of web.config file.
    <SafeControl Assembly="System.Web.Silverlight, 
               Version=2.0.5.0, Culture=neutralPublicKeyToken=31bf3856ad364e35
               Namespace="System.Web.UI.SilverlightControls" TypeName="*" Safe="True" /> 
    <SafeControl Assembly="System.Web.Extensions, 
               Version=3.5.0.0, Culture=neutralPublicKeyToken=31bf3856ad364e35
               Namespace="System.Web.UI" TypeName="*" Safe="True" /> 

    I hope this helps.



    Kind regards,
    Stanimir
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.

  3. Henry
    Henry avatar
    8 posts
    Member since:
    Feb 2009

    Posted 14 Apr 2009 Link to this post

    Hi Stanimir,

    Thank you for your reply, it works!

    However, I am now encountering another error. We've added more columns to our list and I went back and modified the custom new form page to display these new columns. This page works perfectly fine on my end, but everyone else are getting an "unexpected error has occur" message. I turn off the RadEditor feature and everyone was able to see the page, but when i turn the feature back on the page crash.
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 15 Apr 2009 Link to this post

    Hi Henry,

    Could you please send me the code of the page, so I will be able to try reproducing the problem on our test MOSS site?

    Thank you.


    All the best,
    Stanimir
    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.
  5. Henry
    Henry avatar
    8 posts
    Member since:
    Feb 2009

    Posted 15 Apr 2009 Link to this post

    Stanimir,

    There is no code involved. This is using the standard out of the box stuff from SharePoint Designer to create a custom new item form. Create a new ASPX page, attached the default master page template, customize the placeholdermain, drop in a custom list form and tie this new page to the list.
  6. Henry
    Henry avatar
    8 posts
    Member since:
    Feb 2009

    Posted 15 Apr 2009 Link to this post

    Stanimir,

    I think I fixed the problem. My master page template was not checked in. Let's hope I don't run in to more problem.
Back to Top