使用linq to sql产生数据源,DataPager不起作用解决办法!
如果你通过
var procduct=from p in db.products
select p;
ListView1.DataSource = procduct;
ListView1.DataBind();
使用DataPager没反应,添加PagePropertiesChanging事件处理就ok了!
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
this.DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
LoadData();
}