views:

21

answers:

0

I have an asp.net user control with a listview and a DataPager that work as expected if it's loaded statically from an aspx page the usua way.

<%@ Register Src="~/Controls/TricksSummaryOneSubTypeUC.ascx" TagName="sub" TagPrefix="uc1" %>
...
<uc1:sub ID="skdlj" runat="server" TypeId="7" SubTypeId="706" />

But If load it dynamically in a PlaceHolde I lost the DataPager functionallity. On selecting a new page it refresh but without items. When debuging it seems not to be firing events.

TricksSummaryOneUC pageControl = (TricksSummaryOneUC)LoadControl("~/Controls/TricksSummaryOneSubTypeUC.ascx");
pageControl.TypeId = 7;
pageControl.SubTypeId = subcategory;
PHControl.Controls.Add(pageControl);

The DataList is using and ObjectContainerDataSource as data source.