This is a migrated thread and some comments may be shown as answers.
why is loading controls is so slow
1 Answer 56 Views
This is a migrated thread and some comments may be shown as answers.
rob mays
Top achievements
Rank 1
rob mays asked on 07 Oct 2008, 12:51 PM

 

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);

}

}

1 Answer, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 09 Oct 2008, 04:46 PM
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. :)
Asked by
rob mays
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Share this question
or