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

Script controls must be registered using RegisterScriptControl

15 Answers 1138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
TadR
Top achievements
Rank 1
TadR asked on 24 Sep 2008, 03:13 PM
Hello everyone,

I am having a issue that I can't seem to fix. When I call the following in a render overide:

  Dim s_wtr2 As New StringWriter()  
            Dim h_wtr2 As HtmlTextWriter = New HtmlTextWriter(s_wtr2)  
 
            'Check Type  
            If drpType.SelectedValue = "CC Declined" Then 
 
                gridPacc.RenderControl(h_wtr2) 

I get the following error:

Script control 'gridPacc' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl

"grdPacc" is a Q1 asp.net ajax telerik grid.

Any other control done the same way does not produce the error. Any help is appreciated.

15 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 25 Sep 2008, 01:04 PM
Hi TadR,

You cannot invoke the RenderControl() method directly in such a way since this will not work for the standard MS GridView as well. Here is a sample code implementation which threw an exception on my machine related to the GridView instance:

        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        RadGrid  
        <br /> 
        <telerik:RadGrid ID="radgrdData" runat="server" /> 
        MS GridView  
        <br /> 
        <asp:GridView ID="GridView1" runat="server" /> 
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> 

    protected void Button1_Click(object sender, EventArgs e)  
    {  
        DataSet ds = new DataSet();  
        ds.ReadXml(Server.MapPath("~/GridContent.xml"));  
 
        radgrdData.DataSource = ds.Tables[0];  
        radgrdData.DataBind();  
 
        GridView1.DataSource = ds.Tables[0];  
        GridView1.DataBind();  
 
        StringWriter sw = new StringWriter();  
        HtmlTextWriter htw = new HtmlTextWriter(sw);  
 
        GridView1.RenderControl(htw);  
        Response.Write(sw);  
 
        sw = new StringWriter();  
        htw = new HtmlTextWriter(sw);  
 
        radgrdData.RenderControl(htw);  
        Response.Write(sw);  
 
    } 

 
This might be possible for other simple controls like ASP Menu for example but cannot be attained for complex controls like grids, data lists, etc.

Let me know if I am leaving something out.

Kind regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
balaji
Top achievements
Rank 1
answered on 06 Jun 2009, 05:54 AM
Hey Guys Is There Any Other Way to Trouble Shoot this.
I Too Have The Same Problem.
Here is My Sample Cide

private void rendergrid(RadGrid _grid)
    {
        

        
       
        using (StringWriter sw = new StringWriter())
        {
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            
            _grid.RenderControl(htw);
            htw.Flush();
            returnValue = sw.ToString();
        }
    }

The Highlighted One Produced the Error For me Threw The Exception
As it Goes Like This:"Script control 'RadGrid1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl".

Plz also Help Me Guys
Thanks
Regards
N.Balaji
0
sabarishbabu
Top achievements
Rank 1
answered on 07 Apr 2010, 11:35 AM
Hi,

  I have the same problem. Any update in this post.....


Thanks
0
Sebastian
Telerik team
answered on 07 Apr 2010, 02:00 PM
Hi guys,

We introduced RegisterWithScriptManager property for RadGrid for ASP.NET AJAX which can be set to false in order to avoid the exception (see this forum thread for reference). Note, however, that when you set this property to false, you will need to register the grid's client scripts and skins manually with your own code.

Kind regards,
Sebastian
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
sabarishbabu
Top achievements
Rank 1
answered on 07 Apr 2010, 02:23 PM
Hi,
  I am over write the render method for URL re writing

 here i have attached my code...
and i set the RegisterWithScriptManager=false for RadGrid, but still now i got the error


 protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        base.Render(new RewriteFormHtmlTextWriter(writer));
      
    }
This is the error Message

Script control 'menuPages' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl
0
Sebastian
Telerik team
answered on 08 Apr 2010, 09:14 AM
Hello sabarishbabu,

Can you specify whether you have a scriptable control with id 'menuPages' on the same page in which the grid resides? I will appreciate if you post your markup and code-behind using the 'Format code block' dialog in the upper right corner of this forum's editor for further examination. Thus I will do my best to advice you further.

Regards,
Sebastian
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
sabarishbabu
Top achievements
Rank 1
answered on 08 Apr 2010, 01:42 PM
Hi,

  set the "RegisterWithScriptManager" property to false.. finally got the solution...
 But  i am facing  a new problem... 
1.following are the error message i got


Microsoft JScript runtime error: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.

2.Microsoft JScript runtime error: Object doesn't support this property or method

finally i got 7 jscript runtime error ....

how to solve this problem....


Thanks
0
sabarishbabu
Top achievements
Rank 1
answered on 08 Apr 2010, 02:16 PM
Hi,

  Finally i export all controls to pdf using iTextsharp.dll except textboxes...

 How to export textboxes into pdf...


Thanks
0
sabarishbabu
Top achievements
Rank 1
answered on 08 Apr 2010, 02:48 PM
Hi,

  i got a pdf output.. but still now jscript runtime error occur 

1.following are the error message i got


Microsoft JScript runtime error: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.

2.Microsoft JScript runtime error: Object doesn't support this property or method

finally i got 7 jscript runtime error ....

how to solve this problem...
0
Daniel
Telerik team
answered on 13 Apr 2010, 07:07 PM
Hello Sabarishbabu,

You can manually remove the scripts with Regex as demonstrated in the attached demo.

Let me know whether this helps.

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
maha
Top achievements
Rank 1
answered on 01 Jul 2010, 10:49 AM
How can we register the skin files after setting RegisterWithScriptManager  to false? I am using a rotator with a customized skin ,when i set the value to false the CssClass value is not used correctly by the rotator
0
Sebastian
Telerik team
answered on 01 Jul 2010, 12:12 PM
Hi maha,

With script manager registration disabled you will need to register the styles manually on the page using link tags or placing them directly in the head section of the page. In case you use modified or custom rotator skin as external, follow the directions for manual skin registration provided in the corresponding paragraph of this help topic.

Best regards,
Sebastian
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
maha
Top achievements
Rank 1
answered on 01 Jul 2010, 12:38 PM
I registered the skin as said but now the items in the rotator are not displayed as they used to be.It used to be horizontal now all items are displayed vertically and attached to each other.why is this happening?
0
Fiko
Telerik team
answered on 06 Jul 2010, 11:19 AM
Hello Maha,

I believe that these links will be of help:

Greetings,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 22 Aug 2020, 11:52 PM
Hello,
in my case I design an usercontrol and was using with:
var AndamentosCrono1 = (MyControl)Page.LoadControl("~/MyControl.ascx");
and loading into a placeHolder.
The error raised when an old page was trying load with:
<%@ Register Src="MyControl.ascx" TagName="MyControl" TagPrefix="myctl" %>
 <uc1:MyControlID="MyControl1" runat="server" />
After removing the register and reference on page is solved by it self.

#Jefferson2020

Tags
General Discussions
Asked by
TadR
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
balaji
Top achievements
Rank 1
sabarishbabu
Top achievements
Rank 1
Daniel
Telerik team
maha
Top achievements
Rank 1
Fiko
Telerik team
JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or