涉及到得知识点:

1.分页存储过程
2.分页原理
3.jQuery DOM操作
4.jQuery Ajax存取数据
 
效果图:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfcAAACmCAIAAABIslGWAAAUN0lEQVR4nO2dP4jcSNrGFTp0uOmGCxvMwJcMXHKb3cAFZ3BwzoaLPhYHR7PBMTgxQwfDcIE5LjDCQcN21g4WeoIFOTFMBwdyYGgHC3LQwQQXKNiggy/QF0itP6W3Sq/+laRXz48H01NdKr2qV3pUXa12OU5N9p/9soLPDw+3T6IP59Ev30TvnwZvnhxXTrRyopXzsHT2u5/JrVKRLaclylv5P+PXhsAMbzF1PB4fD8HjIQgfH47/vYnuv/3b3585f7hxfvKcN/vvXrrex4fgt+D67cZZRue/Rk/eRc46+uEvP8ZbpXIcR3mhvCZLyK3Mm+gqV7ZsaMcQs6Edc2CGI2IeGue1oRFmImr1T8ue558bnN5rHHy5f+zrX2/uzv/nPL0G21zCZeUbn4PqmjztmP77H/dvn0bvn4arJ94r52H1bPvKefy3E62c4J/Ow7vLwY+zsXIu70VfXkTr8++uXOfP/3KWvvM2cN4fnVXovAl+/BRdfIyc1fHp+8j5443/yVeuqJj0tfJWuXJ5w0rXMFTIU7nrch0Sw3EZGtEdqSHs9iVk/5h3V9mO+aDK7Zg7pNS7FT1G1ikfaXlfhl2Tuyg3aEdw+Q5lOLtoyFa8228f3z0J3jjbfzj7X+/2n/397mfv9tv9rRO+dbavnw5+nI11PB4fvwaPX4PwcRt9OHd/Ot9/2Tt/uHb+8eC8e/zmQ3T9JVp8jr77GDnvo+/uI+dPN5v323iT9nIcp26Fyk1mpa56Q3CvjvPQ4PIdqhuXjz39YfUs+PKQL/d/ud6+fpr4/jSVuvzjYRvdn7s/XTx+Dbz77Td/uXb+vnVW4dP76MkvkfPvwPnfzTd/vfE+PnR4+SXjqaEvOUiqRnuOweU7VEcuL1fH4zH4bR/8tn/86ke/Xvhvn23XN+F/3OOHH91X5zev/vbstXv5yl28+flh9xDXhCC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vNGvYSzpOUeZD0sLyKRsXmoc/5sLK+sp+05tNeRNd+2Tlyvq61+b2OeX5t9q0wzzeyvjr7qKuqzZriny3MvhaLsls31ChVmd2GE9lnJA7E5dvPAvE36rz6aZO4ocgCBqpy7exsPKGOl/usB87bG2Q+CEIkqqRunz6ojzN0uAL1XyD5UIygLp7MbdmOX4IgqBUo3Z58s8GauaSzSr3NGPTICQIgiB3Ei7fXo1dPjXo9N9aw+2uDgcuD0FQY8HlK7ZSPF3n5nB5CILGqVm4vNIys/3yfLqhhV5dvln8EARBbocuz1n3lRlTTy5Gura5PvOLVv67NuOHIAhyY5e3tu4rM6Y+/ItsU+eVBmcnR9OVT9FYjh+CICiV8BmbSp/lz96Ufb/S8dsfTlfxQxA0W43R5SEIgqCuNLzL6x4wt6wRhtQ4fgiCoFTDuzwEQRDUn+DyEARBkgWXhyAIkiy4PARBkGTB5SEIgiQLLg9BECRZcHkIgiDJsufy+88+BEEQZF+WXB4AAMB4gMsDAIBk4PIAACAZuDwAAEgGLg8AAJKBywMAgGT+H6cCAG4IddkoAAAAAElFTkSuQmCC" alt="" />
思路:数据库---DAL----BLL----UI
具体代码:

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go CREATE PROCEDURE [dbo].[GetDataByPager]
(
@startIndex INT,--代表起始条数(从0开始)
@tableName VARCHAR(50),--代表分页的表名称
@pageSize INT=5,--代表每页的条数
@condition VARCHAR(1000)='1=1',--代表条件
@key VARCHAR(20)='id', --代表主键
@orderType VARCHAR(20)='desc' --代表排序方式
)AS
BEGIN
DECLARE @SQL VARCHAR(1000)
SET @SQL='select TOP ' +CONVERT(VARCHAR(20),@pagesize)+' * FROM '+@tableName
+' WHERE '+ @condition+' and '+@key+' NOT IN(SELECT TOP ' +CONVERT(VARCHAR(20),@startIndex)+' '+@key+' FROM '+@tableName+' where '+@condition+' order by '+@key+' '+@orderType+') order by '+@key+' '+@orderType
EXEC(@SQL)
END
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go --得到要分页的表的总记录数
CREATE PROCEDURE [dbo].[GetDataByPager_Count]
(
@tableName VARCHAR(200),
@condition VARCHAR(1000)='1=1'
)
AS
BEGIN
DECLARE @strsql VARCHAR(2000)
SET @strsql = 'select count(*) from '+@tableName+' where '+@condition
EXEC(@strsql)
END

DAL层:

public static partial class AuthorService
{
/// <summary>
/// 分页取数据
/// </summary>
/// <param name="start">起始记录数(从1开始)</param>
/// <param name="limit">每页的条数</param>
/// <param name="condition">查询条件</param>
/// <returns></returns>
public static IList<Author> GetAuthorByPager(int start, int limit, string condition)
{
//string strsql = string.Format("Exec GetDataByPager2 {0},'{1}',{2},'{3}'", start, limit, condition);
string strsql = string.Format("Exec GetDataByPager {0},'{1}',{2},'{3}'", start - 1, "Author", limit, condition); return GetAuthorsBySql(strsql);
}
/// <summary>
/// 条件查询结果集数目
/// </summary>
/// <param name="condition">条件</param>
/// <returns></returns>
public static int GetAuthorByPager_Count(string condition)
{
//string strsql = string.Format("GetDataByPager_Count '{0}'", condition);
string strsql = string.Format("GetDataByPager_Count '{0}','{1}' ", "Author", condition);
return DBHelper.GetScalar(strsql);
}
}

BLL层代码:

 public static partial class AuthorManager
{
/// <summary>
/// 分页取数据
/// </summary>
/// <param name="start">起始记录数(从1开始)</param>
/// <param name="limit">每页的条数</param>
/// <param name="condition">查询条件</param>
/// <returns></returns>
public static IList<Author> GetAuthorByPager(int start, int limit, string condition)
{
return DAL.AuthorService.GetAuthorByPager(start, limit, condition);
}
/// <summary>
/// 条件查询结果集数目
/// </summary>
/// <param name="condition">条件</param>
/// <returns></returns>
public static int GetAuthorByPager_Count(string condition)
{
return DAL.AuthorService.GetAuthorByPager_Count(condition);
}
}

引用了两个常用的js 代码:

  String.format = function() {
if (arguments.length == 0)
return null;
var str = arguments[0];
for (var i = 1; i < arguments.length; i++) {
var re = new RegExp('\\{' + (i - 1) + '\\}', 'gm');
str = str.replace(re, arguments[i]);
}
return str;
}
function StringBuffer()
{
this._strings_=new Array();
}
StringBuffer.prototype.append = function(str)
{
this._strings_.push(str);
}
StringBuffer.prototype.toString=function(){
return this._strings_.join("");
}

UI层得到数据:

public partial class HandleAuthorList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request["startIndex"] != null && Request["limit"] != null)
{
int startIndex = int.Parse(Request["startIndex"].ToString());
int limit = int.Parse(Request["limit"].ToString());
IList<Models.Author> authors = BLL.AuthorManager.GetAuthorByPager(startIndex, limit, "1=1");
string json = JsonHelper.Serialize(authors);
Response.Write(json);
}
else if (Request["type"] != null)
{
int rowCount= BLL.AuthorManager.GetAuthorByPager_Count("1=1");
Response.Write(rowCount);
}
}
}

Ajax异步刷新:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AuthorMgr.aspx.cs" Inherits="AuthorMgr" %>

<!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 id="Head1" runat="server">
<title></title> <script src="scripts/jquery-1.2.6.js" type="text/javascript"></script> <script src="scripts/jquery-1.2.6-vsdoc-cn.js" type="text/javascript"></script> <script src="scripts/string.format.js" type="text/javascript"></script> <script src="scripts/StringBuffer.js" type="text/javascript"></script>
<script type="text/javascript">
<script type="text/javascript">
var pageIndex = 1; //用于保存或设置当前页数
var startIndex = 1; //用于保存或设置记录条数
var limit = 3; //用于设置分页的条数
var rowcount = 0; //表示总记录数
var pageCount = 0; //代表总页数
var oFooter = "<tr align='left' style='color:#003399;background-color:#99CCCC;'>"+
"<td colspan='4'><table border='0'>"+
"<tr><td><a>首页</a></td><td><a>下一页</a></td><td><a>上一页</a></td><td><a>最后一页</a></td></tr>" +
"</table></td></tr>"
function AjaxPager() {
var $table = $("#GridView1");
$("a", $table).attr("href", "javascript:void(0)")
.click(function() {
$("tr>td", $table).parent().remove();
var oA = $(this).text();
if (oA == "首页") {
pageIndex = 1;
} else if (oA == "上一页") {
pageIndex = pageIndex == 1 ? 1 : pageIndex - 1;
} else if (oA == "下一页") {
pageIndex = pageIndex >= pageCount ? pageIndex : pageIndex + 1;
} else {
pageIndex = pageCount;
}
startIndex = (pageIndex - 1) * limit + 1; $.getJSON("HandleAuthorList.aspx", { startIndex: startIndex, limit: limit }, function(josnArray) {
var sb = new StringBuffer();
$.each(josnArray, function(i, item) {
var trTemplate = "<tr style='color:#003399;background-color:White;'>" +
"<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td>" +
"</tr>";
var oTr = String.format(trTemplate, item.id, item.au_Id, item.au_Lname, item.phone);
sb.append(oTr); }) $table.append(sb.toString());
if ($("td>a", $table).length == 0) $table.append(oFooter);
var $tableFooter = $("td>table", $table);
if (pageIndex == 1)
$("tr>td:gt(1)", $tableFooter).hide();
else if (pageIndex == pageCount)
$("tr>td:lt(2)", $tableFooter).hide();
AjaxPager(); })
});
}
$(document).ready(function() {
$.get("HandleAuthorList.aspx", { type: "getcount" }, function(data) {
rowcount = parseInt(data);
if (rowcount % limit == 0)
pageCount = rowcount / limit;
else
pageCount = parseInt(rowcount / limit) + 1;
AjaxPager();
}); });
</script>
</head>
<body>
<form id="form1" runat="server">
<div> <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC"
BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="Id"
DataSourceID="SqlDataSource1" EmptyDataText="没有可显示的数据记录。" PageSize="3"
Width="494px" EnableViewState="False">
<PagerSettings FirstPageText="首页" LastPageText="最后一页"
Mode="NextPreviousFirstLast" NextPageText="下一页" PreviousPageText="上一页" />
<RowStyle BackColor="White" ForeColor="#003399" />
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True"
SortExpression="Id" />
<asp:BoundField DataField="Au_Id" HeaderText="Au_Id" SortExpression="Au_Id" />
<asp:BoundField DataField="Au_Lname" HeaderText="Au_Lname"
SortExpression="Au_Lname" />
<asp:BoundField DataField="Phone" HeaderText="Phone" SortExpression="Phone" />
</Columns>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:JQuerySimpleDBConnectionString1 %>"
DeleteCommand="DELETE FROM [Author] WHERE [Id] = @Id"
InsertCommand="INSERT INTO [Author] ([Au_Id], [Au_Lname], [Au_Fname], [Phone], [Addr], [City], [State], [Zip]) VALUES (@Au_Id, @Au_Lname, @Au_Fname, @Phone, @Addr, @City, @State, @Zip)"
ProviderName="<%$ ConnectionStrings:JQuerySimpleDBConnectionString1.ProviderName %>"
SelectCommand="SELECT [Id], [Au_Id], [Au_Lname], [Au_Fname], [Phone], [Addr], [City], [State], [Zip] FROM [Author] order by Id desc"
UpdateCommand="UPDATE [Author] SET [Au_Id] = @Au_Id, [Au_Lname] = @Au_Lname, [Au_Fname] = @Au_Fname, [Phone] = @Phone, [Addr] = @Addr, [City] = @City, [State] = @State, [Zip] = @Zip WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Au_Id" Type="String" />
<asp:Parameter Name="Au_Lname" Type="String" />
<asp:Parameter Name="Au_Fname" Type="String" />
<asp:Parameter Name="Phone" Type="String" />
<asp:Parameter Name="Addr" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Au_Id" Type="String" />
<asp:Parameter Name="Au_Lname" Type="String" />
<asp:Parameter Name="Au_Fname" Type="String" />
<asp:Parameter Name="Phone" Type="String" />
<asp:Parameter Name="Addr" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="State" Type="String" />
<asp:Parameter Name="Zip" Type="String" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource> </div>
</form>
</body>
</html>

jQuery+存储过程实现无刷新分页(九)的更多相关文章

  1. 无刷新分页 jquery.pagination.js

     无刷新分页 jquery.pagination.js 采用Jquery无刷新分页插件jquery.pagination.js实现无刷新分页效果 1.插件参数列表 http://www.dtan.so ...

  2. jquery ajax php+mysql 无刷新分页 详细实例

    最近在接触jquery和ajax,当前项目也会用到分页,为了用户体验更好一些,就准备用无刷新分页,这个demo很适合新手学习查看,写的比较清晰,话不多说,直接上代码吧. 首先是html页面,index ...

  3. javascript;Jquery;获取JSON对象,无刷新分页,异步加载,异步删除,实例。

    AjaxNewsList: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> < ...

  4. ASP.NET Ajax简单的无刷新分页

    最近练习了一些AJAX无刷新分页,写得比较简单,性能不知道怎么样,求大神指点,如有更好的分页提供,欢迎交流! 发话不多说了,直接上代码! 首先从网上下了一个JS分页,感觉挺好用的 (function( ...

  5. asp.net练习②——Paginaton无刷新分页

    aspx代码: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server" ...

  6. MVC无刷新分页(即局部刷新,带搜索,页数选择,排序功能)

    我查看了很多网站,大部分评论分页都是局部刷新的,可大部分电商商品展示分页都是有刷新页面的,于是我便做了一个商品展示无刷新分页的例子.接下来我就将做一个模仿淘宝已买到的宝贝功能,不过我的是无刷新分页的. ...

  7. thinkphp ajax 无刷新分页效果的实现

    思路:先做出传统分页效果,然后重新复制一份Page.class.php类,对它进行修改,把js中的函数传到page类中,把上一页.下一页.首页.尾页.链接页中的url地址改成js控制的函数,模板页面中 ...

  8. asp.net MVC4 +MVCpager 无刷新分页

    本人菜鸟,最近在用MVC4和MVCpager做无刷新分页时,发现点击下一页时数据不是Ajax提交的,弄了好久终于找到原因,原来还是Jquery引用的问题,现在把代码粘出来,希望能帮到刚接触的程序员,第 ...

  9. MVC无刷新分页

    MVC无刷新分页(即局部刷新,带搜索,页数选择,排序功能)   我查看了很多网站,大部分评论分页都是局部刷新的,可大部分电商商品展示分页都是有刷新页面的,于是我便做了一个商品展示无刷新分页的例子.接下 ...

随机推荐

  1. JavaSE学习总结(十五)—— Java反射与注解

    一.静态语言与动态语言 静态类型语言:是指在编译时变量的数据类型即可确定的语言,多数静态类型语言要求在使用变量之前必须声明数据类型,某些具有类型推导能力的现代语言可能能够部分减轻这个要求.强类型 动态 ...

  2. Spring Schedule整合配置

    Spring Schedule是spring提供的任务调度框架.很简单,也很强大,简单是因为只需要在spring配置文件中写一行代码配置一下.就ok,强大是因为调度表达式.这里会给出一个网站,在线生成 ...

  3. HDU - 3478 Catch(判奇环/二分图)

    http://acm.hdu.edu.cn/showproblem.php?pid=3478 题意 给一个无向图和小偷的起点,小偷每秒可以向相邻的点出发,问有没有一个时间点小偷可能出现在任何点. 分析 ...

  4. hashmap和hashtable异同

    (一)继承的历史不同 Hashtable是继承自Dictionary类的,而HashMap则是Java 1.2引进的Map接口的一个实现. public class Hashtable extends ...

  5. Centos下新建用户及修改用户目录

    Centos下新建用户及修改用户目录 Hillgo 关注 2015.09.22 01:32* 字数 154 阅读 3492评论 0喜欢 3 添加及删除用户 添加用户 test: adduser tes ...

  6. Python探测主机端口是否存活

    #!/usr/bin/python3 import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = s ...

  7. Bugly实现app全量更新

    转 http://blog.csdn.net/qq_33689414/article/details/54911895Bugly实现app全量更新 Bugly官网文档 一.参数配置 在app下的gra ...

  8. c#中如何在一个panel中放入窗体

    Form2 f2 = new Form2(); //实例化窗体FORM2 f2.TopLevel = false; //设置为非顶级窗体 f2.FormBorderStyle = FormBorder ...

  9. 第16月第23天 atos

    1. grep --after-context=2 "Binary Images:" *crash xcrun atos -o zhiniao_adhoc_stg1.app.dSY ...

  10. 解决Centos下yum无法更新

    问题: http://mirrors.cloud.aliyuncs.com/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - ...