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

Difference between RadAjaxManager and RadScriptManager

3 Answers 234 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 18 Dec 2012, 11:30 AM

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

3 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 18 Dec 2012, 04:26 PM
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.
0
Venkatesh
Top achievements
Rank 1
answered on 19 Dec 2012, 05:24 AM
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
0
Accepted
Maria Ilieva
Telerik team
answered on 21 Dec 2012, 12:18 PM
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.
Tags
Ajax
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Venkatesh
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or