栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > asp

asp.net jquery无刷新分页插件(jquery.pagination.js)

asp 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

asp.net jquery无刷新分页插件(jquery.pagination.js)

采用Jquery无刷新分页插件jquery.pagination.js 实现无刷新分页效果
友情提示:本示例Handler中采用StringBuilder的append方法追加HTML,小数据量可以,但是大数据或是布局常变,建议返回JSON格式的数据,性能和灵活性更好!

1.插件参数列表

 
2.页面内容
复制代码 代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>



Porschev----无刷新翻页









Posrchev----无刷新分页







编号 名称






3.页面.cs文件内容
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
public string pageCount = string.Empty; //总条目数
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pageCount = new PagerTestBLL.PersonManager().GetPersonCount().ToString();
}
}
}

4.Handler中的内容
复制代码 代码如下:
<%@ WebHandler Language="C#" Class="PagerHandler" %>
using System;
using System.Web;
using System.Collections.Generic;
using System.Text;
public class PagerHandler : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
string str = string.Empty;
//具体的页面数
int pageIndex;
int.TryParse(context.Request["pageIndex"], out pageIndex);
//页面显示条数
int size = Convert.ToInt32(context.Request["pageSize"]);
if (pageIndex == 0)
{
pageIndex = 1;
}
int count;
List list = new PagerTestBLL.PersonManager().GetAllPerson(size, pageIndex, "", out count);
StringBuilder sb = new StringBuilder();
foreach (PagerTestModels.Person p in list)
{
sb.Append("");
sb.Append(p.Id.ToString());
sb.Append("");
sb.Append(p.Name);
sb.Append("");
}
str = sb.ToString();
context.Response.Write(str);
}
public bool IsReusable {
get {
return false;
}
}
}

5.实现效果图


源码下载
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/58166.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号