日期:2014-05-20 浏览次数:21005 次
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Datagridpaper._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>Client Side Pagination - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="css/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="css/themes/icon.css">
<link rel="stylesheet" type="text/css" href="css/demo.css">
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<%-- <script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
var MQ = $.noConflict(true);
</script>--%>
<script type="text/javascript">
$(function(){
$('#newsList').datagrid({
title: '新闻详细列表',
iconCls: 'icon-save',
width: 600,
height: 250,
url: '/NewsHandler.ashx',
columns: [[
{ field: 'Id', title: '编号', width: 80 },
{ field: 'Title', title: '新闻标题', width: 80 },
{ field: 'Content', title: '内容', width: 80, align: 'right' },
{ field: 'CreateTime', title: '更新时间', width: 80, align: 'right' },
{ field: 'PublishTime', title: '发布时间', width: 80, align: 'right' },
{ field: 'Author', title: '发布者', width: 100 }
]],
pagination: true
});
//设置分页控件
var p = $('#newsList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数,默认为10
pageList: [5,10,15],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
onBeforeRefresh:function(){
$(this).pagination('loading');
alert('before refresh');
$(this).pagination('loaded');
}
});
});
</script>
</head>
<body>
<h2>Client Side Pagination</h2>
<div class="demo-info">
<div class="demo-tip icon-tip"></div>
<div>This sample shows how to implement client side pagination in DataGrid.</div>
</div>
<div style="margin:10px 0;"></div>
<table id="newsList"></table>
</body>
</html>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
using NHibernate.Mapping;
using TLAgent.App.Core.Helpers;
using TLAgent.DB.Global;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
namespace Datagridpaper
{
/// <summary>
/// Summary description for $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class NewsHandler : IHttpHandler