asp.net2.0(c#) 开发webformRepeater控件的自定义分页的功能已经实现了,不过还有一个问题一直也没有搞定,请看我的问题:现在我使用DropDownList来显示页码,因为我不知道 1 2 3 4 5…… ,这种分页页码形式是用什么办法实现的??是一个控件??请指点一下,谢谢!!!学习,关注…………

解决方案 »

  1.   

    自己生成HTML放进去的
    <a href=XX?page=1>1</a>...
      

  2.   

    既然你会 DropDown 为什么不会这个?DropDownList 是将页码添加进其 Items而 1 2 3  就是添加创建 HyperLink 或者 直接使用 <a href=... > 假如你用的是 PostBack 方式,那么就应该动态创建 LinkButton 控件
      

  3.   

    分页写在存储过程中。。传入pageIndex和pageSize即可
      

  4.   

    pageIndex和pageSize 是哪里的属性???请给段代码我看看,谢谢!!!关注……………………
      

  5.   

    LZ:再说明一下,分页我已经实现了,只是不知道如何来实现12345……,这种页码的形式(暂时用DropDownList来代替)!!请给一段关于12345……,这种页码实现的办法就行了!!!关注…………
      

  6.   

    最简单的方法:用aspnetpager免费的分页控件,这中样式设置一个属性就可以了哦!
      

  7.   

    再说明一下,分页我已经实现了,只是不知道如何来实现12345……,这种页码的形式(暂时用DropDownList来代替)!!
    -------------------------------------
    要實現12345……自己要寫code.....
    天轟穿有一段視頻(第50,51級)有講到Repeater的分頁...你可以去看看
    http://thcjp.cnblogs.com/
      

  8.   

    要實現12345……自己要寫code.....
    ---------------------------------------就不能贴一下这个功能的代码啊?????????
      

  9.   

    看看先!!http://thcjp.cnblogs.com/
      

  10.   


            LblCurrentIndex.Text = "当前是第<font color=#CC0000>" + this.pageIndex + " </font>页";
            LblPageCount.Text = "共 <font color=3366FF>" + this.pageCount + " </font>页,";
            LblRecordCount.Text = "<font color=3366FF>"+this.recordCount + "</font>条";        if (pageCount == 1)
            //this.pageLabel.Text = "上一页 / 下一页";
            {
                btnFirst.Text = "<a href='#'  class=pagesup>首页</a>";
                btnPrev.Text = "<a href='#'  class=pagesup>上一页</a>";
                btnNext.Text = "<a href='#'  class=pagesup>下一页</a>";
                btnLast.Text = "<a href='#'  class=pagesup>尾页</a>";        }
            else if (pageIndex <= 1)
            {
                this.btnFirst.Text = "<a href='#'  class=pagesup>首页</a>";
                btnPrev.Text = "<a href='#'  class=pagesup>上一页</a>";
                btnNext.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}'  class=pagesup>下一页</a>", this.pageIndex + 1,this.myDL.SelectedValue,this.DropDownList1.SelectedValue);
                btnLast.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup >尾页</a>", this.pageCount, this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
            }        else if (pageIndex >= this.pageCount)
            {
                this.btnFirst.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>首页</a>", '1', this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
                btnPrev.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>上一页</a>", this.pageIndex - 1, this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
                btnNext.Text = "<a href='#'  class=pagesup>下一页</a>";
                btnLast.Text = "<a href='#'  class=pagesup>尾页</a>";
            }        else if (pageIndex > 1 && pageIndex < this.pageCount)
            {
                this.btnFirst.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>首页</a>", '1', this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
                btnPrev.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>上一页</a>", this.pageIndex - 1, this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
                btnNext.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>下一页</a>", this.pageIndex + 1, this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
                btnLast.Text = string.Format("<a href='orderlist.aspx?page={0}&searchstring1={1}&searchstring2={2}' class=pagesup>尾页</a>", this.pageCount, this.myDL.SelectedValue, this.DropDownList1.SelectedValue);
            }
      

  11.   

    给你翻译了一篇,自己看吧【翻译】带有分页及postback功能的Repeater控件
    http://bbs.msproject.cn/default.aspx?g=posts&t=447--------------------------------------------------
    http://bbs.msproject.cn/开源技术社区