Hello,
I've got a ListView and a DataPager on my ASPX page. I bind the ListView in my code behind:
EGDataContext db = new EGDataContext();
var ads = (from a in db.Ads
where a.SubCategoryId == subCategoryId
orderby a.PostedOn descending
select a);
this.lvAds.DataSource = ads;
this.lvAds.DataBind();
My problem is that when I bind the ListView using the code above, my paging doesn't works correctly (pages don't change) but when I have a LinqDataSource on the ASPX page itself and bind the ListView using it's DataSourceID property and paging works correctly and as expected.
My question is that is the paging supposed to work if I bind the ListView from code behind? And if it is, then what am I missing?
Thanks in advance