if(e.Item.ItemType==ListItemType.Pager)
{
lb = new LinkButton();
lb.Text="首页 ";
e.Item.Controls[0].Controls.AddAt(0,lb);
end = new LinkButton();
end.Text=" 末页";
e.Item.Controls[0].Controls.Add(end);
this.lb.Click+=new EventHandler(lb_Click);
this.end.Click+=new EventHandler(end_Click);
HyperLink zong = new HyperLink();
zong.Text=" 共"+this.DataGNews.PageCount+"页 ";
e.Item.Controls[0].Controls.Add(zong);
HyperLink per = new HyperLink();
per.Text=" 15条/页 ";
e.Item.Controls[0].Controls.Add(per);
HyperLink cur = new HyperLink();
cur.Text="当前页是"+(this.DataGNews.CurrentPageIndex+1)+"页";
ddl = new DropDownList();
ddl.AutoPostBack=true;
for(int i=0;i<this.DataGNews.PageCount;i++)
{
ddl.Items.Add(new ListItem("第"+(i+1)+"页",(i+1).ToString()));
}
ddl.SelectedIndexChanged+=new EventHandler(ddl_SelectedIndexChanged);
e.Item.Controls[0].Controls.Add(ddl);
}
文章来源:
http://www.cnblogs.com/wangdetian168/archive/2008/06/25/1230017.html
posted on 2010-09-28 11:00
sanmao 阅读(144)
评论(0) 编辑 收藏