Json作为一种轻量级的数据交换格式,由于其传输数据格式的方便性,今天偶然想将其应用于分页实现,分页做为web开发一个长久的话题,其应用的高效与重要性就不多说了
本文主要技术:反射机制,Json数据格式,jquery
为了应用的通用性,首先要根据反射机制,能将要返回的任意类型的结果对象转化成Json类型的格式。
public static String toJSON(Object obj) {
HashMap map = new HashMap();
Class c = obj.getClas
这个教程也包含有实现Flickr、Digg式的简洁分页样式的HTML/CSS代码,随时可以应用于你的WEB项目中。
Update as March 17, 2008: My friends Simone Saveri solved some issuse with IE6 and IE7.
Download this tutorial (original)
Download this tutorial (Simone Saveri version)
典型的分页结构下图显示的是一个典型分页结构
本人写的一个分页Helper,支持普通分页(也就是,首页、上一页、下一页、末页等),综合分页(普通分页和数字分页的综合)。
下面是分页效果:
分页代码:
PagerHelper.cs
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Text;
using System.Web.Mvc;
usi