asp_异步增删查改(3)

来源:互联网 发布:2016中超网络直播权 编辑:程序博客网 时间:2024/05/18 20:12

GetNewsById.ashx:

 public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int id = int.Parse(context.Request["id"]??"0");
            BLL.HKSJ_Main mainServer = new BLL.HKSJ_Main();
            Model.HKSJ_Main main = mainServer.GetModel(id);
            System.Web.Script.Serialization.JavaScriptSerializer javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            string strJson = javaScriptSerializer.Serialize(main);
            context.Response.Write(strJson);
        }

原创粉丝点击