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

script control 'RadAjaxManager1" is not a registered script control.

8 Answers 455 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 20 Jul 2011, 03:41 PM
I am trying to place a radscheduler as a user control on one of my pages, I am getting this error

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

it's weird because when I run my code on my local machine everything is honky dory, but once I move it to the server it no longer works.

 any ideas on why this would be happening?

code:
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
......
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <%--//commentedout to seperate grid from scheduler
            <telerik:AjaxSetting AjaxControlID="RadGrid1">--%>
            <telerik:AjaxSetting AjaxControlID="RadScheduler3">
            <UpdatedControls>
                <%--//commentedout to seperate grid from scheduler
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />--%>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler3" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <%--<telerik:AjaxSetting AjaxControlID="Panel1">
         <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler3" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />

                    </UpdatedControls>
        </telerik:AjaxSetting>--%>
    </AjaxSettings>
</telerik:RadAjaxManager>
<%--<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
 <asp:Label id="Label2" runat="server" ForeColor="Red">Loading... </asp:Label>
</telerik:RadAjaxLoadingPanel> />
--%>
.......


<telerik:RadScheduler ID="RadScheduler3"
RegisterWithScriptManager="false"
    runat="server"
    DataEndField="EndDate"
    DataKeyField="EventID"
    DataSourceID="Event"
    DataStartField="StartDate"
    DataSubjectField="Description"
    Skin="Sunset"
    DayView-UserSelectable="false"
    WeekView-UserSelectable="false"
    SelectedView="MonthView"
    TimelineView-UserSelectable="false"
    MonthView-VisibleAppointmentsPerDay="10"
    OverflowBehavior="Scroll"
    OnAppointmentDataBound="RadScheduler3_AppointmentDataBound"
    OnPreRender="RadScheduler3_PreRender"
    OnAppointmentUpdate="Update"
    OnAppointmentDelete="Delete"
    MinimumInlineFormWidth="700"
    OnClientAppointmentContextMenu="appointmentContextMenu"
    MinimumInlineFormHeight="1500"
    AppointmentContextMenuSettings-Skin="Sunset"
    Width="100%"
    Height="1000px"
    OnFormCreated="RadScheduler3_FormCreated"
    ShowViewTabs="false"
    TimelineView-NumberOfSlots="10"
    StartEditingInAdvancedForm ="true"
     
    StartInsertingInAdvancedForm="true">
    <Reminders Enabled="True" />
.....................
</telerik:RadScheduler>


Thanks,

Adam Pierce



8 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 21 Jul 2011, 11:18 AM
Hello Adam,

The recommended practice is to put RadAjaxManager on your page or master page, and use RadAjaxManagerProxy in the user control.


Best wishes, Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

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

I'm getting the same javascript error while integrating a RadGrid in RadScheduler.

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:31 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:47 AM
0
Peter
Telerik team
answered on 02 Aug 2011, 09:02 AM
Hi Francesco,

I noticed that you have configured RadAjaxManagerProxy to ajaxify RadScheduler. In this case, all controls in the advanced form will also be ajaxified and there is no need to wrap RadGrid in an UpdatePanel.

I did a sample using your code, but everything worked as expected. Please, test the attached demo and let me know what is different at your side.


Greetings, Peter
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Francesco
Top achievements
Rank 1
answered on 02 Aug 2011, 03:44 PM
Thank you for your help, Peter. I tried this scenario on a clean demo of Customizing Advanced Form Template before and worked, just like your project, but in our project the same thing failed.
We've already opened a ticket with the project attached and your team was able to reproduce the issue and solve it.

There is another problem which emerged from the resolution of this, but it has nothing to do with Ajax settings so I consider this discussion closed.

Thank you and your team for your support.
Regards,
Francesco
0
Bex
Top achievements
Rank 1
answered on 10 Oct 2012, 08:24 AM
I am having a very similar problem.
I know this is an old post but can anyone post what the problem was and how it was resolved?
0
Plamen
Telerik team
answered on 15 Oct 2012, 07:42 AM
Hi Bex,

 
You can refer to the recommended practices when RadAjaxManager is on your page or master page, and use RadAjaxManagerProxy in the user control. If you still can't figure out what is causing the issue please elaborate a little bit the exact scenario so we can be more helpful.

All the best,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Adam
Top achievements
Rank 1
Answers by
Peter
Telerik team
Francesco
Top achievements
Rank 1
Bex
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or