<div class="pg right">
                                <span class="pgDisabled">上一页</span><a href="#">上一页</a><strong class="pgCurr">1</strong><a
                                    href="#2">2</a><a href="#2">3</a><a href="#2">4</a><a href="#2">5</a><a href="#2">6</a><span
                                        class="pgEllipsis">...</span><a href="#2">199</a><a href="#2">200</a><span class="pgDisabled">下一页</span><a
                                            href="#2">下一页</a></div>
样式类似http://blog.sina.com.cn/s/articlelist_1423290444_0_1.html 底下的分页 我现在页面设计没有用js脚本  大家有经验的说这个用什么做比较方便

解决方案 »

  1.   


    <webdiyer:AspNetPager ID="aspPager" runat="server" OnPageChanged="aspPager_PageChanged" HorizontalAlign="Center" UrlPaging="True">
     </webdiyer:AspNetPager>后台这么写
    /// <summary>
        /// 分页控件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void aspPager_PageChanged(object sender, EventArgs e)
        {
            this.aspPager.CurrentPageIndex = e.NewPageIndex;
            this.aspPager.DataBind();    }
    提示错误根本没有 NewPageIndex定义 
    和跟网上的例子不一样 这两个有什么区别?//翻页事件     protected void ChangePage(object src, PageChangedEventArgs e)     {         pager1.CurrentPageIndex = e.NewPageIndex;         BindData();     }    
      

  2.   

    aspnetpager分页控件不错
    看看使用方法
      

  3.   

    http://www.webdiyer.com/AspNetPager挺好用的、看看这里。
      

  4.   

    用AspNetPager控件吧
    前台用:
        <webdiyer:AspNetPager ID="Pager"  runat="server" AlwaysShow="true" FirstPageText="[首页]"
                                            HorizontalAlign="Right" LastPageText="[尾页]" NextPageText="[后页]" PrevPageText="[前页]"
                                            SubmitButtonText="跳转" PagingButtonSpacing="10px" CustomInfoSectionWidth="60%"
                                            CustomInfoTextAlign="Right" CustomInfoHTML="分页:<font color='red'>%CurrentPageIndex%</font>/%PageCount%&nbsp;&nbsp;&nbsp;记录:%StartRecordIndex%-%EndRecordIndex%&nbsp;&nbsp;"
                                            ShowCustomInfoSection="Left" OnPageChanging="Pager_PageChanging" />
      后台用:
               protected void Bind()
            {
                int ReCount = 0;
                rPhotoTypeList.DataSource = BLL.PhotoType.GetList(out ReCount, CurPage, PageSize);
                rPhotoTypeList.DataBind();
                Pager.PageSize = PageSize;
                Pager.CurrentPageIndex = CurPage;
                Pager.RecordCount = ReCount;
            }        /// <summary>
            /// 分页控件的分页事件
            /// </summary>
            /// <param name="src"></param>
            /// <param name="e"></param>
            protected void Pager_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
            {
                CurPage = e.NewPageIndex;
                Bind();
            }以上只供参考,局部地方需要自己修改
      

  5.   


    不知道为什么我的分页控件就是不显示  分页控件只是设置了aspPager_PageChanging事件  调了半天了protected void aspPager_PageChanging(object src, PageChangingEventArgs e)
        {
            this.aspPager.CurrentPageIndex = e.NewPageIndex;
            //绑定  
       }
      

  6.   

    不知道为什么我的分页控件就是不显示 分页控件只是设置了aspPager_PageChanging事件 
      

  7.   

    不知道为什么我的分页控件就是不显示  分页控件只是设置了aspPager_PageChanging事件
      

  8.   

    转变思想,那是ASP用的,。NET的GRIDVIEW,FORMSVIEW,DETAILVIEWL都自带分页,且可以自己定义,DATAGRID可以分页,请自己定义分页,DATALIST,REPEATER默认不可以分页,但还是可以分页,请自定义分页,但是method="post"
      

  9.   


    使用asp那种复古的方法 可以灵活使用分页 现在就想把分页控件给调出来 总是出现错误 gv的分页样式太难看了