日期:2014-05-17 浏览次数:20424 次
<webdiyer:AspNetPager ID="AspNetPager1" runat="server" PagingButtonSpacing="8px" showcustominfosection="Right" CustomInfoHTML="总记录数:%RecordCount%,总页数:%PageCount%,当前为第%CurrentPageIndex%页" urlpaging="True" width="100%" LayoutType="Table" ShowNavigationToolTip="true" UrlPageIndexName="pageindex" onpagechanged="AspNetPager1_PageChanged" onpagechanging="AspNetPager1_PageChanging" PageSize="15"> </webdiyer:AspNetPager>
protected void Page_Load(object sender, EventArgs e) { } public void BindGridView() { //关键代码段 PagedDataSource pds = new PagedDataSource(); pds.AllowPaging = true; pds.DataSource = _DataSet.Tables[0].DefaultView; AspNetPager1.RecordCount = pds.DataSourceCount; AspNetPager1.AlwaysShow = true; pds.PageSize = AspNetPager1.PageSize; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; _GridView.DataSource = pds; _GridView.DataBind(); } protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e) { AspNetPager1.CurrentPageIndex = e.NewPageIndex; BindGridView(); }
protected void Page_Load(object sender, EventArgs e) { GvTemplet.BindGridView(); } //点击该按钮,GV无刷新效果 protected void BtnOneQuery_Click(object sender, EventArgs e) { }