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

[Solved] "'RadTabStrip1' is not a registered script control" in a grid

8 Answers 284 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sammy78
Top achievements
Rank 2
Sammy78 asked on 21 May 2010, 01:53 PM
Good morning,
I'm trying to make a radGrid with an nested part that is multipage (much like this example, but with forms in the multipages that interact with the database(which aren't implemented yet)). Since Wednesday, I get the following error when I try to expand a row:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Script control 'RadTabStrip1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl


The page used to work, without any problem, displaying the nested view correctly. I tried to check the differences in the code (including the code behind) to find what could have caused the change and honestly, I'm stumped. Any help would be GREATLY appreciated.

Here's the code for my grid:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" DataSourceID="obsDetailsLogclByCat" 
    GridLines="None" Skin="Vista" AllowAutomaticUpdates="True" AllowMultiRowSelection="false" 
    ShowGroupPanel="true" AllowAutomaticInserts="True" AllowAutomaticDeletes="True"> 
    <MasterTableView DataSourceID="obsDetailsLogclByCat" GroupLoadMode="Server" CommandItemDisplay="Top" 
        CommandItemSettings-AddNewRecordText="Ajouter un nouveau logiciel" EditFormSettings-ColumnNumber="2" 
        AllowAutomaticUpdates="True" AllowAutomaticInserts="True" CommandItemStyle-ForeColor="White" 
        AllowAutomaticDeletes="True"> 
        <Columns> 
            <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow" 
                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                UniqueName="DeleteColumn"> 
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
            </telerik:GridButtonColumn> 
        </Columns> 
        <NestedViewSettings DataSourceID="obsDetailsLogclByCat"> 
            <ParentTableRelation> 
                <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" /> 
            </ParentTableRelation> 
        </NestedViewSettings> 
        <NestedViewTemplate> 
            <asp:panel runat="server" id="InnerContainer" cssclass="viewWrap" visible="false"> 
                <telerik:RadAjaxPanel ID="rapMultiPage" runat="server" Width="1100px"> 
                    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" 
                        SelectedIndex="0" Skin="Vista" RegisterWithScriptManager="true" ClickSelectedTab="True" 
                        CausesValidation="True"> 
                        <Tabs> 
                            <telerik:RadTab PageViewID="RadPageView1" Selected="True" Text="Détails du logiciel"> 
                            </telerik:RadTab> 
                            <telerik:RadTab PageViewID="RadPageView3" Text="Certification"> 
                            </telerik:RadTab> 
                            <telerik:RadTab PageViewID="RadPageView4" Text="Historique"> 
                            </telerik:RadTab> 
                            <telerik:RadTab PageViewID="RadPageView5" Text="Déplacement / copie"> 
                            </telerik:RadTab> 
                        </Tabs> 
                    </telerik:RadTabStrip> 
                    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"> 
                         
                        <telerik:RadPageView ID="RadPageView1" runat="server"> 
                            <div class="contactWrap"> 
                                <h1> 
                                    Détails du logiciel</h1> 
                                <br /> 
                                <asp:Image ID="Image1" runat="server" ImageUrl="Images/duplicate.gif" /> 
                            </div> 
                        </telerik:RadPageView> 
                        <telerik:RadPageView ID="RadPageView3" runat="server"> 
                            <div class="contactWrap"> 
                                <h1> 
                                    Certification</h1> 
                                <br /> 
                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/page.aspx">Envoi vers un autre site</asp:HyperLink> 
                            </div> 
                        </telerik:RadPageView> 
                        <telerik:RadPageView ID="RadPageView4" runat="server"> 
                            <div class="contactWrap"> 
                                <h1> 
                                    Historique</h1> 
                                <br /> 
                                Page Content 
                            </div> 
                        </telerik:RadPageView> 
                        <telerik:RadPageView ID="RadPageView5" runat="server"> 
                            <div class="contactWrap"> 
                                <h1> 
                                    Déplacement / copie</h1> 
                                <br /> 
                                <asp:Button ID="Button1" runat="server" Text="Refresh" /> 
                                <br /> 
                                <telerik:RadTextBox ID="RadTextBox1" runat="server"> 
                                </telerik:RadTextBox> 
                                <br /> 
                                <br /> 
                                <telerik:RadListBox ID="RadListBox1" runat="server" AllowAutomaticUpdates="True" 
                                    AllowDelete="True" AllowReorder="True"> 
                                </telerik:RadListBox> 
                            </div> 
                        </telerik:RadPageView> 
                    </telerik:RadMultiPage> 
                </telerik:RadAjaxPanel> 
            </asp:panel> 
        </NestedViewTemplate> 
        <CommandItemSettings AddNewRecordText="Ajouter un nouveau logiciel" /> 
        <EditFormSettings ColumnNumber="2"> 
        </EditFormSettings> 
    </MasterTableView> 
</telerik:RadGrid> 

Thanks!


8 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 27 May 2010, 08:20 AM
Hello Sam,

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.

Sincerely yours,
Pavlina
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
Sammy78
Top achievements
Rank 2
answered on 27 May 2010, 03:50 PM
Thanks Pavlina for the reply.
I'll try your solution and will get back if I have any news.
0
Sammy78
Top achievements
Rank 2
answered on 04 Jun 2010, 04:26 PM
Hi again,
just to let you know that we decided to use another solution involving radWindows instead, simplifying the navigation for our client in the context that he needed this grid.

Thanks again

Sam
0
Francesco
Top achievements
Rank 1
answered on 27 Jul 2011, 05:09 PM
Hello,

I'm having problems integrating a RadGrid in RadScheduler for the same javascript error.

I followed the advanced form customization guide (because my advanced form is more complex). I defined a custom user control in which there is a RadTabStrip with 3 tabs and inside one of them I integrated a RadGrid, with paging, sorting and filtering. The RadScheduler is defined in a user control that is the content of a masterpage, and it's ajaxified using RadAjaxManager (declared into masterpage but set using the Proxy inside the usercontrol). It is databound to a collection filled from a database, as well as the the DataTable bound to RadGrid.

Here is some excerpt from Master and content page to show Ajax, ScriptManager and RadScheduler settings:

Masterpage:
...
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ScriptManager2" runat="server">
        <Scripts>
            <asp:ScriptReference Path="AdvancedForm.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
    ...
    <asp:ContentPlaceHolder ID="PlaceHolder" runat="server" />
    ...
    </form>
</body>

Content page:
...
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolder" runat="server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    ....
   <telerik:RadScheduler ID="RadScheduler1" runat="server" ... >
                <AdvancedForm Modal="true" />
                <AppointmentTemplate>
                    ...
                </AppointmentTemplate>
                <InlineInsertTemplate>
                    <scheduler:InlineInsertForm runat="server" ID="InlineInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>'... />
                </InlineInsertTemplate>
                <AdvancedInsertTemplate>
                    <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>' ...  />
                </AdvancedInsertTemplate>
                <AdvancedForm EnableCustomAttributeEditing="True" />
                <AdvancedEditTemplate>
                    <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' ...  />
                </AdvancedEditTemplate>
   </telerik:RadScheduler>
</asp:Content>


Since every action which triggers a postback (in this case, sorting, changing page and filtering) causes the loss of the state of the advanced form (every field becomes empty), I wrapped the RadGrid in a RadAjaxPanel. Now any of that action gives me the javascript error "Script control 'rfltMenu' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors()." and if I remove filtering support, it gives me the same error on another grid component and so on.

I read that the RegisterWithScriptManager attribute was introduced to handle these errors, I've set it to false and called the RegisterScriptControl() passing the RadGrid instance in the OnPreRender method of the AdvancedForm usercontrol, but to no avail.

Here is some excerpt from the usercontrol:

Excerpt from AdvancedForm.aspx:
<telerik:RadAjaxPanel ID="contactsRefreshPanel" runat="server">
    <telerik:RadGrid AutoGenerateColumns="false" ID="ContactsGrid"
        OnNeedDataSource="ContactsGrid_NeedDataSource"
        AllowSorting="True" AllowFilteringByColumn="true"
        AllowPaging="True" PageSize="2"
        RegisterWithScriptManager="false"
        runat="server">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView AutoGenerateColumns="false" TableLayout="Auto">
            <Columns>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Nome" SortExpression="Name"
                    UniqueName="Name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Surname" HeaderText="Cognome" SortExpression="Surname"
                    UniqueName="Surname" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Company" HeaderText="Azienda" SortExpression="Company"
                    UniqueName="Company" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Email" HeaderText="Email" SortExpression="Email"
                    UniqueName="Email" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CellularPhone" HeaderText="Cellulare" SortExpression="CellularPhone"
                    UniqueName="CellularPhone" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>

Excerpt from AdvancedForm.cs:
public partial class AdvancedForm : System.Web.UI.UserControl
    {
        ...
        protected void Page_Load(object sender, EventArgs e)
        {
            UpdateButton.ValidationGroup = Owner.ValidationGroup;
            UpdateButton.CommandName = Mode == AdvancedFormMode.Edit ? "Update" : "Insert";
 
            InitializeStrings();
            InitializeRecurrenceEditor();
           
            // A series of client scripts registered
             
        }
        ...
        protected void ContactsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            ContactsGrid.DataSource = Default.GetDataTable("SELECT * FROM Contacts");
        }
        ...
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
 
            if (!FormInitialized)
            {
                FormInitialized = true;
            }
 
            if (!this.DesignMode)
            {
                // Test for ScriptManager and register if it exists
                ScriptManager sm = ScriptManager.GetCurrent(Page);
 
                if (sm == null)
                    throw new HttpException("A ScriptManager control must exist on the current page.");
 
                sm.RegisterScriptControl(ContactsGrid);
            }
        }
        ...
    }

Perhaps there something in the Ajax settings which isn't correct? I tried many things, including using RadAjaxManagerProxy to ajaxify the grid only but without results.
Any other suggestion is welcome. I'm stuck on this problem for 2 days.

By the way, I'm using RadControls Q1 2011 SP2.

Thanks in advance!
0
Francesco
Top achievements
Rank 1
answered on 28 Jul 2011, 04:32 PM
No one has any advice on what could be the cause of the error, or something to try to find it out?
I'm stuck here and I need to deliver this part of the software next week, so I'm a little strict on time...

Thank you!
0
Francesco
Top achievements
Rank 1
answered on 29 Jul 2011, 09:44 AM
0
yogesh
Top achievements
Rank 1
answered on 12 Jan 2012, 08:54 AM
how to register the grid's client scripts and skins manually ?
0
Shinu
Top achievements
Rank 2
answered on 12 Jan 2012, 09:16 AM
Hello Yogesh,

Check the following help documentations.
Skin registration
http://www.telerik.com/help/aspnet-ajax/grid-getting-client-object.html

-Shinu.
Tags
Grid
Asked by
Sammy78
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Sammy78
Top achievements
Rank 2
Francesco
Top achievements
Rank 1
yogesh
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or