repeater分页实例

repeater分页实例

ID:9281814

大小:39.50 KB

页数:4页

时间:2018-04-26

repeater分页实例_第1页
repeater分页实例_第2页
repeater分页实例_第3页
repeater分页实例_第4页
资源描述:

《repeater分页实例》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、repeater分页实例usingSystem;usingSystem.Data;usingSystem.Data.SqlClient;usingSystem.Configuration;usingSystem.Collections;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;usingSystem.Web.UI.WebControls.WebParts;usingSy

2、stem.Web.UI.HtmlControls;publicpartialclassrepeate:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){if(!IsPostBack){Repeater1.DataSource=pds();Repeater1.DataBind();}}privatePagedDataSourcepds(){stringconnstring=ConfigurationManager.Connec

3、tionStrings["pconn"].ConnectionString;SqlConnectioncon=newSqlConnection(connstring);DataSetds=newDataSet();SqlDataAdaptersda=newSqlDataAdapter("select*fromauthors",con);sda.Fill(ds,"name");SqlDataAdaptersda2=newSqlDataAdapter("select*fromtitleauthor",con);

4、sda2.Fill(ds,"title");ds.Relations.Add("myrela",ds.Tables["name"].Columns["au_id"],ds.Tables["title"].Columns["au_id"]);PagedDataSourcepds=newPagedDataSource();pds.DataSource=ds.Tables["name"].DefaultView;pds.AllowPaging=true;//允许分页pds.PageSize=5;//单页显示项数p

5、ds.CurrentPageIndex=Convert.ToInt32(Request.QueryString["page"]);returnpds;}protectedvoidRepeater1_ItemDataBound(objectsender,RepeaterItemEventArgse){if(e.Item.ItemType==女包、名牌包、背包:www.naitiao.com

6、冬装新款、流行冬装、今年流行秋冬装:dongzhuang.qqxk.netListItemType.Footer){Dr

7、opDownListddlp=(DropDownList)e.Item.FindControl("ddlp");HyperLinklpfirst=(HyperLink)e.Item.FindControl("hlfir");HyperLinklpprev=(HyperLink)e.Item.FindControl("hlp");HyperLinklpnext=(HyperLink)e.Item.FindControl("hln");HyperLinklplast=(HyperLink)e.Item.Find

8、Control("hlla");pds().CurrentPageIndex=ddlp.SelectedIndex;intn=Convert.ToInt32(pds().PageCount);//n为分页数inti=Convert.ToInt32(pds().CurrentPageIndex);//i为当前页Labellblpc=(Label)e.Item.FindControl("lblpc");lblpc.Text=n.ToString();Labellblp=(Label)e.Item.FindCon

9、trol("lblp");lblp.Text=Convert.ToString(pds().CurrentPageIndex+1);if(!IsPostBack){for(intj=0;j

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。