Application taking long time when loading data using RadAjaxManager

5 posts, 0 answers
  1. David
    David  avatar
    1 posts
    Member since:
    Aug 2011

    Posted 27 Jun 2013 Link to this post

    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();
            }
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 02 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matthew Smith
    Matthew Smith avatar
    1 posts
    Member since:
    Aug 2009

    Posted 09 Jul 2013 Link to this post

    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.).
  5. moegal
    moegal avatar
    273 posts
    Member since:
    Jul 2007

    Posted 11 Jul 2013 Link to this post

    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
  6. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 11 Jul 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017