<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脚本 大家有经验的说这个用什么做比较方便
解决方案 »
- Javascript正则表达式该怎么写
- BS结构或BS结构的PHP JavaScript 能获取客户端硬件信息吗?
- JQ事件注册实现拖动层 代码交流
- Jquery 的问题,高手进来看看谁遇到过?
- 事关此次加薪的问题:老板出了个难题,打开一个页面时,要求用户不能copy,print,甚至也不能print screen.有没有这样的javascript?
- 求一小段Javascript代码——打开了子窗口后,禁止操作父窗口
- **** 低级问题,字符串问题,在线等 *****
- 请教怎样动态为变量赋值(想用eval函数)
- 在线等,解决就给分:如何提交iframe中的值?
- 如何实现:在页面上按住鼠标左键,拖动一矩形面积,当放开鼠标时弹出该矩形的坐标<left,top,width,heigh>?
- JS删除数组元素问题
- jquery在函数内部新建对象错误
<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(); }
看看使用方法
前台用:
<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% 记录:%StartRecordIndex%-%EndRecordIndex% "
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();
}以上只供参考,局部地方需要自己修改
不知道为什么我的分页控件就是不显示 分页控件只是设置了aspPager_PageChanging事件 调了半天了protected void aspPager_PageChanging(object src, PageChangingEventArgs e)
{
this.aspPager.CurrentPageIndex = e.NewPageIndex;
//绑定
}
使用asp那种复古的方法 可以灵活使用分页 现在就想把分页控件给调出来 总是出现错误 gv的分页样式太难看了