why is loading controls is so slow

2 posts, 0 answers
  1. rob mays
    rob mays avatar
    58 posts
    Member since:
    Jun 2007

    Posted 07 Oct 2008 Link to this post

     

    if i load one or two controls then is is not bad but my controls have comboboxes and everytime a postback happens the all the controls are loaded again. if i have 6 controls loaded then the performance is very poor. any ideas on how this can be speeded up. Ideally i would only like the control to load when the tabstrip index is changed?

    protected
    void RadMultiPage1_PageViewCreated1(object sender, RadMultiPageEventArgs e)

     

    {

     

    string userControlName = string.Empty; // "~/monarch/ControlPages/" + e.PageView.ID + ".ascx";

     

     

    if (e.PageView.ID == "Customer")

     

    {

    userControlName =

    "~/monarch/ControlPages/SingleEntryView.ascx";

     

    }

     

    else

     

    {

    userControlName =

    "~/monarch/ControlPages/SingleMeasureView.ascx";

     

    }

     

    if (userControlName.Length > 0)

     

    {

     

    Control userControl = Page.LoadControl(userControlName);

     

    userControl.ID = e.PageView.ID +

    "_UserControl";

     

    e.PageView.Controls.Add(userControl);

    }

    }

  2. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 09 Oct 2008 Link to this post

    Hey Rob,

    Have you tried using load on demand for controls like in this demo?

    I've used the methods included there and it had a pretty dramatic effect on the load time for me. :)
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top