Ajax结合Js操作灵活操作表格
2014-09-26 15:30
211 查看
Table页面:
其他的ashx可参照此例
<%@ WebHandler Language="C#" Class="LoadAllLogInfo" %> using System; using System.Web; using System.Data; using System.Linq; using System.Text; using System.Collections.Generic; using EFDataEntities; using EFDemoLite.Data.Infrastructure; using EFDemoLite.Data.Repositories; public class LoadAllLogInfo : IHttpHandler { public IPM_LogUploadInfoRepository logRep = new PM_LogUploadInfoRepository(DatabaseFactory.GetFactory()); public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; var list = logRep.GetAll().ToList(); var recList = new List<LogPathModel>(); foreach (var item in list) { recList.Add(new LogPathModel { Lid=item.LID, Path=item.LogPath, PType=item.LogPathType=="0"?"絕對路徑":"相對路徑" }); } System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); string jsonStr = js.Serialize(recList); context.Response.Write(jsonStr); } class LogPathModel { public string Lid { get; set; } public string Path { get; set; } public string PType { get; set; } } public bool IsReusable { get { return false; } } }
其他的ashx可参照此例
相关文章推荐
- js(jquery)与ajax结合实现无刷新操作
- DhtmlxGrid组件应用---结合Ajax实现对表格数据的无刷新操作
- js 对表格进行各种操作
- 使用JS操作页面表格,元素的一些技巧
- js表格操作图片复选框
- 一些常用的JS (JONEAjax) 获取dom 对象,ajax操作,读写cookie
- JS获取dom 对象 ajax操作 读写cookie函数
- js对表格行进行操作.获取单元格的值等
- js操作ajax返回的json的注意问题!
- js操作cookie;js的setInterval;C#获取指定页面的内容;Ajax.dll的使用
- js操作表格
- js中对表格的操作总结
- js 表格操作
- js 对表格进行各种操作
- 看看JS中操作表格
- JS操作表格
- 使用JS操作页面表格,元素的一些技巧
- JS操作表格
- js 操作表格大全
- js操作表格