具有许多用户控件的Repeater Itemdatabound太慢

时间:2013-04-04 11:02:28

标签: c# asp.net repeater itemdatabound

您好我创建了一个Web应用程序,其中我遇到了性能问题,因为我在itemdatabound上的转发器中绑定了15个用户控件,并且我使用usercontrol的prerender事件绑定数据,请您建议我替代此

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
    DataRowView row = e.Item.DataItem as DataRowView;
    HomePhought uxHomePhought = (HomePhought)e.Item.FindControl("uxHomePhought");
    HomeConnection uxHomeConnection = (HomeConnection)e.Item.FindControl("uxHomeConnection");
    HomeTestimonialPublished uxHomeTestimonial = (HomeTestimonialPublished)e.Item.FindControl("uxHomeTestimonial");
    HomeProfileEdit uxHomeProfileEdit = (HomeProfileEdit)e.Item.FindControl("uxHomeProfileEdit");
    HomeMemex uxHomeMemex = (HomeMemex)e.Item.FindControl("uxHomeMemex");
    HomeInterestMemex uxHomeInterestMemex = (HomeInterestMemex)e.Item.FindControl("uxHomeInterestMemex");
    HomeMemexPhought uxHomeMemexPhought = (HomeMemexPhought)e.Item.FindControl("uxHomeMemexPhought");
    //HomeBFFTips uxHomeBFFTip = (HomeBFFTips)e.Item.FindControl("uxHomeBFFTip");
    HomePageCreate uxHomePageCreate = (HomePageCreate)e.Item.FindControl("uxHomePageCreate");
    HomePageHiveFive uxHomePageHiveFive = (HomePageHiveFive)e.Item.FindControl("uxHomePageHiveFive");
    HomePageNewsAdd uxHomeBusinessNewsAdd = (HomePageNewsAdd)e.Item.FindControl("uxHomeBusinessNewsAdd");
    HomePageNewsComment uxHomePageNewsComment = (HomePageNewsComment)e.Item.FindControl("uxHomePageNewsComment");
    HomePageNewsHighFive uxHomePageNewsHighFive = (HomePageNewsHighFive)e.Item.FindControl("uxHomePageNewsHighFive");
    HomeMedalAchieved HomeMedalAchieved1 = (HomeMedalAchieved)e.Item.FindControl("HomeMedalAchieved1");

    ...................
    ...................
    //  Binding user controls
    ...................
    ...................

}

0 个答案:

没有答案