日期:2014-05-17  浏览次数:20443 次

起一个jquery绑定及分页源码!!!!!!100分啊啊啊啊啊啊啊啊啊啊
如题,要源码

------解决方案--------------------
尼玛,异步啊。
------解决方案--------------------
例子 简单 GridView AJAX 局部刷新分页例子
http://dotnet.aspx.cc/file/GridView-Ajax-Paging.aspx
------解决方案--------------------
更多的代码
采用Jquery无刷新分页插件jquery.pagination.js 实现无刷新分页效果

------解决方案--------------------
很强大
http://demos.telerik.com/aspnet-mvc/grid

可以只把他的js及样式拷贝出来,并按着json样式给数据

------解决方案--------------------
前台html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="js/jquery-1.4.2-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$.post("JQWSXFY.ashx",{"action":"getpagecount"},function (data, status) {
for (var i = 1; i <= data; i++) {
var td = $("<td><a href=''>" + i + "</a></td>");
$("#trPage").append(td);
}
$("#trPage td").click(function (e) {
e.preventDefault();
$.post("JQWSXFY.ashx", { "action": "getpagedata", "pagenum":$(this).text() },
function (data, staus) {
var comments = $.parseJSON(data);
$("#ulComment").empty();
for (var i = 0; i < comments.length; i++) {
var comment = comments[i];
var li = "<li>" + comment.id + comment.name + comment.Development + comment.Note + comment.Datetime + "</li>";
$("#ulComment").append(li);
}
});
});

});
});

</script>
</head>
<body>
<div >
<ul id="ulComment">


</ul>
<table>
<tr id="trPage"></tr>

</table>
</div>
</body>
</html>

后台一般处理程序:
<%@ WebHandler Language="C#" Class="JQWSXFY" %>

using System;
using System.Web;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Script.Serialization;
using System.Collections.Generic;

public class JQWSXFY : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
string action=context.Request["action"];//无法获取action的值
//string action=context.Request.Form["action"];
// string action=context.Request.QueryString["action"];
// string action = context.Request.Params["a"];
// string action = "getpagedata";
string pagenum = context.Request["pagenum"];//无法获取pagenum的值
//string pagenum = "1";

int pagecount;//总页数
if (action == "getpagecount")