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

Application taking long time when loading data using RadAjaxManager

4 Answers 150 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
dave
Top achievements
Rank 1
dave asked on 27 Jun 2013, 06:43 PM
We are using latest telerik controls. In a page, I have a grid on the left side, which loads all customers' name (approx 3500) and
5 raddocks which display some information related to customer. On page load, it takes approx 7-8 seconds to load whole page with 3500 records in Customer grid and raddock with information of first selected customer. On selectedindexchange event of grid, we display the information related to selected customer in rad docks. We are using RadAjaxManager for displaying the information on selectedindexchange. In this case, it takes approx 40-50 seconds to display the data in raddocks. We checked in SQL Server Profiler, it took 30-35 seconds for sending the request to sql server. If we have less data in Customer grid (like 30-40), it works fine but if our records increase, performance gets down. It means, it is something related to Customer record but we are surprised that why it's taking time when we are using ajax and it should load only data in rad dock. Even on page load, it doesn't take much time.

CustomerManager customerManager;
 
        #region Page Events
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                PopulateCustomerList();
            }           
        }
 
        #region "dgrManageCustomer Events"
        protected void dgrManageCustomer_SortCommand(object sender, GridSortCommandEventArgs e)
        {
            GridSortExpression sortExpr = new GridSortExpression();
            switch (e.OldSortOrder)
            {
                case GridSortOrder.None:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = GridSortOrder.Descending;
 
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
                case GridSortOrder.Ascending:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = dgrManageCustomer.MasterTableView.AllowNaturalSort ? GridSortOrder.None : GridSortOrder.Descending;
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
                case GridSortOrder.Descending:
                    sortExpr.FieldName = e.SortExpression;
                    sortExpr.SortOrder = GridSortOrder.Ascending;
 
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                    break;
            }
            e.Canceled = true;
            PopulateCustomerList();
            this.dgrManageCustomer.Rebind();
        }
 
        protected void dgrManageCustomer_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            PopulateCustomerList();
        }
 
        protected void dgrManageCustomer_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridDataItem selectedItem = (GridDataItem)dgrManageCustomer.SelectedItems[0];
            hidCustomerID.Value = Convert.ToInt64(selectedItem.GetDataKeyValue("CustomerID")).ToString();
             PopulateCustomerDetails();
        }

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 02 Jul 2013, 10:12 AM
Hello David,

Could you please share your RadAjax settings and the page markup where the RadGrid and the RadDock controls are placed? Also I would suggest you to review the help topic below for more information on performance optimization with ajax:
http://www.telerik.com/help/aspnet-ajax/ajax-client-side-performance.html

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
0
Matthew Smith
Top achievements
Rank 1
answered on 10 Jul 2013, 03:12 AM
Hi David.

Have you found a solution for this? I have a similar problem where when updating a radgrid from a RadAjaxManager_AjaxRequest it takes as much as 30 seconds.

We are are simply doing an SQL search (which is subsecond) and returning the resulting employee records (usually only about 10).

It appears that when the AJAX request is sent, it is sending the entire viewstate of the page (including the contents of every control, grid etc.).
0
moegal
Top achievements
Rank 1
answered on 11 Jul 2013, 09:26 AM
I am having some issues with speed as well.

I have one page that loads in less then 1 second but the ajax(when a event is fired) on the page takes 6 seconds or more.

Marty
0
Marin
Telerik team
answered on 11 Jul 2013, 10:23 AM
Hello,

 You are right, the entire ViewState of the page is sent to the server during an ajax request as required by the ASP.NET framework, but this alone cannot slow down the page to such extent.
Also if you are binding the grid only to 10 records this should not affect the performance either.
Performance issues normally appear if you have very complex layout of the page with many heavy controls in it; if you are displaying a very large number of records or if the query to the data access layer takes too long to be executed.
Additionally you can also further debug the separate events of the page life cycle to see which one might be causing the slowdown.
The ajax request itself should not impact the performance, rather what is going on in the server-side code of the page might be the reason for the issue. So you can check there as well.

Regards,
Marin
Telerik
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 the blog feed now.
Tags
Ajax
Asked by
dave
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Matthew Smith
Top achievements
Rank 1
moegal
Top achievements
Rank 1
Marin
Telerik team
Share this question
or