分享一个asp.net pager分页控件(2)


<!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>
<link href="https://www.jb51.net/CSS/JPager.css" type="text/css" />
<script src="https://www.jb51.net/JS/jquery.min.js" type="text/javascript"></script>
<script src="https://www.jb51.net/JExtension/JPager.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#pager").JPager({ customer:{template:"%cuRRent%"},count: 10, action: { url: "Service/JService.svc/GetPersons", data: '{"name":"zhoulq"}'}, showNumber: true },1,5);
});
</script>
</head>
<body>
<table>
</table>
<div></div>
</body>
</html>


wcf:

复制代码 代码如下:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
namespace JPlugin
{
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class JService
{
[OperationContract]
[WebInvoke]
public PageObject<Person> GetPersons(string name,int pageIndex,int paseSize)
{
return new PageObject<Person>(){RecordCount = 23,SearchResult = new List<Person>(){new Person(){Name="zhpulq",Age = 28},new Person(){Name = "zhouxy",Age = 24}}};
}
}
public class PageObject<T>
{
public int RecordCount { get; set; }
public List<T> SearchResult { get; set; }
}
}

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdjdps.html