Difference between RadAjaxManager and RadScriptManager

4 posts, 1 answers
  1. Venkatesh
    Venkatesh avatar
    88 posts
    Member since:
    Nov 2012

    Posted 18 Dec 2012 Link to this post

    Hi,

    I am using Sharepoint 2010. I have added the rad grid and i also added the radajax manager.

    I would like to know the difference between "RadAjaxManager and RadScriptManager" and whcih should be used in sharepoint 2010?

    Below is the radajax code i have used:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="radgrid1">
                            <UpdatedControls>
     <telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
    <telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                    Width="75px" Transparency="25">
                    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                        style="border: 0;" /></telerik:RadAjaxLoadingPanel>

    Also, in the cs, i have manually added the ajax as below for sharepoint 2010:
    RadAjaxManager ajaxmgr;
      
            protected override void CreateChildControls()
            {
                Control control = Page.LoadControl(_ascxPath);
                Controls.Add(control);
      
                RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
                RadGrid grid = control.FindControl("radgrid1") as RadGrid;
                //Find more controls to add to the ajax settings
                if (ajaxmgr != null)
                {
                    ajaxmgr.AjaxSettings.AddAjaxSetting(grid, grid, loadingPanel);
                }
      
            }
      
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                ajaxmgr = RadAjaxManager.GetCurrent(Page);
                if (ajaxmgr == null)
                {
                    ajaxmgr = new RadAjaxManager();
                    Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
                }
      
                if (Page.Form != null)
                {
                    Page.Form.Controls.AddAt(0, ajaxmgr);
                }
                EnsureChildControls();
            }

    Thanks
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 18 Dec 2012 Link to this post

    Hello Venkatesh,

    The RadScriptManager is required in order to load and combine the scripts used by the ASP.NET Ajax controls. This is an alternative to the ScriptManager control.

    The RadAjaxManager is used to "ajaxify" controls in a much more flexible way than the RadAjaxPanel.

    I hope that explains the difference.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Venkatesh
    Venkatesh avatar
    88 posts
    Member since:
    Nov 2012

    Posted 18 Dec 2012 Link to this post

    Hi,
    Thanks for the reply.
    Is the code snippet which i have provided correct with respect to sharepoint 2010?

    Also, if i add the RadScriptManager, i get the error as "only one instance of script manager can be added in the page"

    Thanks
  5. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 21 Dec 2012 Link to this post

    Hi,

    The error means that you have another ScriptManager on the page which is not allowed as the RadScriptManager is a singleton control. Please make a global search into your application and verify if another RadScriptManager appear on some of the pages.

    Greetings,
    Maria Ilieva
    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.
Back to Top