数据空间配合aspnetpager分页控件试用
2013-06-12 15:20
417 查看
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SqlConnection con = new SqlConnection(strconn);
con.Open();
com = new SqlCommand();
com.Connection = con;
com.CommandText = "select count(*) from (select a.题名,b.id,b.MetaId,b.Videos_Path,b.Thumbnail_Path from dbo.MDLS_Literature_Metadata a left join MDLS_Literature_Videos b on a.SYSID=b.MetaId where b.id in(select min(id) from MDLS_Literature_Videos
group by MetaId) and a.资源类型='视频') as mm";
AspNetPager1.AlwaysShow = true;
AspNetPager1.PageSize = 15;
AspNetPager1.RecordCount = (int)com.ExecuteScalar();
con.Close();
RepeaterDataBind();
}
}
private void RepeaterDataBind()
{
dr = new SqlDataAdapter("select * from (select a.题名,b.id,b.MetaId,b.Videos_Path,b.Thumbnail_Path from dbo.MDLS_Literature_Metadata a left join MDLS_Literature_Videos b on a.SYSID=b.MetaId where b.id in(select min(id) from MDLS_Literature_Videos group
by MetaId) and a.资源类型='视频') as mm",strconn);
ds = new DataSet();
dr.Fill(ds, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize,"mmm");
this.ReVideos.DataSource = ds;
this.ReVideos.DataBind();
}
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
AspNetPager1.CurrentPageIndex = e.NewPageIndex;
RepeaterDataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
RepeaterDataBind();
}
{
if (!IsPostBack)
{
SqlConnection con = new SqlConnection(strconn);
con.Open();
com = new SqlCommand();
com.Connection = con;
com.CommandText = "select count(*) from (select a.题名,b.id,b.MetaId,b.Videos_Path,b.Thumbnail_Path from dbo.MDLS_Literature_Metadata a left join MDLS_Literature_Videos b on a.SYSID=b.MetaId where b.id in(select min(id) from MDLS_Literature_Videos
group by MetaId) and a.资源类型='视频') as mm";
AspNetPager1.AlwaysShow = true;
AspNetPager1.PageSize = 15;
AspNetPager1.RecordCount = (int)com.ExecuteScalar();
con.Close();
RepeaterDataBind();
}
}
private void RepeaterDataBind()
{
dr = new SqlDataAdapter("select * from (select a.题名,b.id,b.MetaId,b.Videos_Path,b.Thumbnail_Path from dbo.MDLS_Literature_Metadata a left join MDLS_Literature_Videos b on a.SYSID=b.MetaId where b.id in(select min(id) from MDLS_Literature_Videos group
by MetaId) and a.资源类型='视频') as mm",strconn);
ds = new DataSet();
dr.Fill(ds, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize,"mmm");
this.ReVideos.DataSource = ds;
this.ReVideos.DataBind();
}
protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
{
AspNetPager1.CurrentPageIndex = e.NewPageIndex;
RepeaterDataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
RepeaterDataBind();
}
相关文章推荐
- PagedDataSource数据绑定控件和AspNetPager分页控件结合使用列表分页
- Entity Framework后台采用分页方式取数据与AspNetPager控件的使用
- 利用AspNetPager控件实现数据分页(存储过程)
- DbEntry采用分页技术显示数据在GridView里面并用AspNetPager控件来显示分页
- 利用分页控件AspNetPager来做数据的分页
- Entity Framework后台采用分页方式取数据与AspNetPager控件的使用
- 打造通用ASP.NET数据分页控件
- AspNetPager分页控件
- AspNetPager控件实现网页分页显示
- 打造一个通用ASP.NET数据分页控件
- Asp.Net分页和AspNetPager控件的使用
- ASP.NET 数据列表控件的分页总结
- 吴旗娃分页控件,DataGrid,DropDownList编辑删除DataGrid数据
- 发现一个分页控件AspNetPager
- 用AspNetPager控件最详细的分页实现方法
- VS-利用AspNetPager控件实现真分页
- 数据显示控件的通用分页代码
- asp.net下Repeater使用 AspNetPager分页控件
- 使用AspNetPager分页控件、分页存储过程及用户控件基类实现的完美分页功能
- Repeater控件绑定数据、分页、数据操作,最佳代码