Script control 'Window' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().

3 posts, 0 answers
  1. M
    M avatar
    24 posts
    Member since:
    Jul 2012

    Posted 03 Jan 2012 Link to this post

    When I click the Submit Button, I'm getting this error:
    Script control 'Window' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
    Parameter name: scriptControl


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_Default" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        </telerik:RadStyleSheetManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
         
        <div>
     
     
        <table>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label runat="server" ID="admin_header" Text='<%#Eval("s_title")%>' Font-Bold="true"
                        Font-Names="verdana" Font-Size="Medium" ForeColor="White" ToolTip='<%#Eval("s_title")%>'></asp:Label>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td width="761" align="right">
                    <asp:FormView ID="fv1" DataSourceID="SqlDataSource1" runat="server" DataKeyNames="cid" DefaultMode="edit">
                        <EditItemTemplate>
                            <div align="left">
                                <asp:Label ID="Label1" runat="server" Text="Page Name:" CssClass="content_text_left_bold"></asp:Label><br />
                                <asp:TextBox ID="s_page_name" runat="server" Text='<%#Bind("s_page_name")%>' Width="761" />
                                <asp:Label ID="Label2" runat="server" Text="Title:" CssClass="content_text_left_bold"></asp:Label><br />
                                <asp:TextBox ID="s_title" runat="server" Text='<%#Bind("s_title")%>' Width="761" />
                                <asp:Label ID="Label4" runat="server" Text="Meta Keywords:" CssClass="content_text_left_bold"></asp:Label><br />
                                <asp:TextBox ID="s_meta_keywords" runat="server" Text='<%#Bind("s_meta_keywords")%>'
                                    Width="761" Rows="4" Wrap="true" TextMode="MultiLine" />
                                <asp:Label ID="Label5" runat="server" Text="Meta Description:" CssClass="content_text_left_bold"></asp:Label><br />
                                <asp:TextBox ID="s_meta_description" runat="server" Text='<%#Bind("s_meta_description")%>'
                                    Width="761" Rows="4" Wrap="true" TextMode="MultiLine" />
                                <div>
                                    <div>
                                        <telerik:RadEditor ID="RadEditor1" runat="server"
                                            ImageManager-UploadPaths="/images/content/"
                                            ImageManager-DeletePaths="/images/content/"
                                            ImageManager-ViewPaths="/images/content/"
                                            Content='<%# Bind("page_content") %>'
                                            Height="800px" Width="690px"
                                            ContentAreaCssFile="~/admin/ContentAreaStyleSheet.css"
                                            OnClientLoad="OnClientLoad"
                                            ContentFilters="FixEnclosingP">
                                            <FontNames>
                                                <telerik:EditorFont Value="Arial" />
                                                <telerik:EditorFont Value="Baskerville Old Face" />
                                                <telerik:EditorFont Value="Bookman old style" />
                                                <telerik:EditorFont Value="Calibri" />
                                                <telerik:EditorFont Value="Century Gothic" />
                                                <telerik:EditorFont Value="Comic Sans MS" />
                                                <telerik:EditorFont Value="Constontia" />
                                                <telerik:EditorFont Value="Cooper Black" />
                                                <telerik:EditorFont Value="Courier New" />
                                                <telerik:EditorFont Value="Garamond" />
                                                <telerik:EditorFont Value="Georgia" />
                                                <telerik:EditorFont Value="Lucida Sans" />
                                                <telerik:EditorFont Value="Lucida Sans Unicode" />
                                                <telerik:EditorFont Value="MS Sans Serif" />
                                                <telerik:EditorFont Value="Segoe UI" />
                                                <telerik:EditorFont Value="Tahoma" />
                                                <telerik:EditorFont Value="Times New Roman" />
                                                <telerik:EditorFont Value="Verdana" />
                                            </FontNames>
                                        </telerik:RadEditor>
                                    </div>
                                     
     
                                <asp:Button ID="Button1" runat="server" Text="Submit Changes" CommandName="update" />
                            </div>
                        </EditItemTemplate>
                    </asp:FormView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
                        SelectCommand="SELECT * FROM [content]where cid=@cid"
                        UpdateCommand="UPDATE [content] SET [page_content] = @page_content, [s_title] = @s_title, [s_meta_keywords] =@s_meta_keywords, [s_meta_description] =@s_meta_description, [s_page_name] =@s_page_name WHERE cid=@cid"
                        CancelSelectOnNullParameter="false">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="cid" Type="string" QueryStringField="cid" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        </div>
    <script type="text/javascript">
        function OnClientLoad(editor) {
            var tool = editor.getToolByName("ForeColor");
     
            //Add the button to the color picker            
            tool.old_renderFooter = tool.renderFooter;
            tool.renderFooter = function () {
                this.old_renderFooter();
                //Create a button and add it to the tool
                var button = document.createElement("button");
                button.innerHTML = "Add custom color..";
                button.onclick = showColorDialog;
                this.get_popupElement().appendChild(button);
            }
     
            function showColorDialog() {
                var myCallbackFunction = function (sender, color) {
                    var colors = tool.get_items();
     
                    //If no colors are set get the colors from the editor
                    if (colors.length == 0) {
                        colors = editor.get_colors();
                    }
     
                    colors[colors.length] = color;
                    tool.set_items(colors);
                    //Set the color to the current selection
                    editor.get_document().execCommand("ForeColor", false, color);
                }
     
                //Hide the color picker
                tool.hide();
     
                //Show the Custom Color dialog
                editor.showExternalDialog(
                          'ForeColorDialog.aspx',
                          null,
                          600,
                          400,
                          myCallbackFunction,
                          null,
                          'ForeColor',
                          true,
                          Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                          false,
                          false);
            }
        };
    </script>
        <telerik:RadAjaxManager runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadEditor1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadEditor1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
     
     
        </form>
    </body>
    </html>
    Web.Config
    <configuration>
        <connectionStrings>
            <add name="ConnectionString" connectionString="Data Source=SQL2008;Initial Catalog=121212;Persist Security Info=True;User ID=121212;Password=121212" providerName="System.Data.SqlClient" />
        </connectionStrings>
        <location path="Telerik.Web.UI.WebResource.axd">
            <system.web>
                <authorization>
                    <allow users="*"/>
                </authorization>
            </system.web>
        </location>
        <system.web>
            <compilation debug="true" targetFramework="4.0">
                <assemblies>
                    <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                    <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                </assemblies>
            </compilation>
            <customErrors mode="Off" />
            <httpHandlers>
                <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
                <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
                <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
            </httpHandlers>
        </system.web>
        <system.webServer>
            <validation validateIntegratedModeConfiguration="false" />
            <handlers>
                <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
                <add name="Telerik_Web_UI_SpellCheckHandler_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" />
                <add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" />
            </handlers>
        </system.webServer>
        </configuration>

  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 03 Jan 2012 Link to this post

    M:

    Are you using a RadWindow as the script control that is referenced here as "Window"? If so, be sure that you reference this thread for a possible solution:

    Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors()

    Hope this helps.
  3. M
    M avatar
    24 posts
    Member since:
    Jul 2012

    Posted 03 Jan 2012 Link to this post

    I solved the issue!
    I removed the RadAjaxManager and it worked perfectly.

    <telerik:RadAjaxManager runat="server">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadEditor1">
    <UpdatedControls>
    <telerik:AjaxUpdatedControl ControlID="RadEditor1" />
    </UpdatedControls>
    </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManager>
Back to Top