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

PreRender Error with Custom list form

5 Answers 199 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Henry
Top achievements
Rank 1
Henry asked on 08 Apr 2009, 04:01 PM
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

5 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 09 Apr 2009, 08:05 AM
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.
0
Henry
Top achievements
Rank 1
answered on 14 Apr 2009, 08:21 PM
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.
0
Stanimir
Telerik team
answered on 15 Apr 2009, 06:36 AM
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.
0
Henry
Top achievements
Rank 1
answered on 15 Apr 2009, 03:42 PM
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.
0
Henry
Top achievements
Rank 1
answered on 15 Apr 2009, 03:55 PM
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.
Tags
WebParts for SharePoint
Asked by
Henry
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Henry
Top achievements
Rank 1
Share this question
or