C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着

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);

   } 

posted on 2008-06-25 23:10  王德田  阅读(249)  评论(0编辑  收藏