标签:private public records return
ListData.cs 类
using System;
using System.Collections.Generic;
using System.Web;
using System.Text;
public class ListData
{
private int pageSize;
public int PageSize
{
get { return pageSize; }
set { pageSize = value; }
}
private int records;
public int Records
{
get { return records; }
set { records = value; }
}
public ListData()
{
}
public ListData(int pageSize, int records)
{
this.PageSize = pageSize;
this.Records = records;
}
public string ToJson()
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
return serializer.Serialize(this);
}
}
一般处理程序ashx:
ListData ldata = new ListData();实例化类
ldata.PageSize = pageSize;//每页显示多少条记录
ldata.Records = recount;//总记录数
context.Response.Write(ldata.ToJson());//输出到页面
页面接收值:
$(function () {
var title = $("#Info_title").text(); //评论主题
var url = ‘<wtl:system type="Systempath"></wtl:system>sitecn/conmmentOn/ConmmentOnListPage.ashx‘;//链接地址:一般处理程序地址
var date = { ctent: "0", pageTopic: "page_indexs",title:title };
$.post(url, date, function (getdata) {
var tip = eval("(" + getdata + ")");
$("#page_count").html("" + tip.Records + "");//总条数
$("#page_Size").html("" + tip.PageSize + ""); //每页显示几条
});
});
标签:private public records return
原文地址:http://haihuiwei.blog.51cto.com/4789207/1606738