//获取所有课程信息 public void getList(HttpContext context) { HttpResponse response = context.Response; int page = Int32.Parse(context.Request["page"]); int size = Int32.Parse(context.Request["rows"]); String json = ""; CourseModel coursemodel = new CourseModel(); List <Bap_Course> list = coursemodel.list(page, size); int total = coursemodel.count(); response.ContentEncoding = UTF8Encoding.UTF8; response.ContentType = "text/plain"; json = "{\"total\":" + total + ",\"rows\":" + new JavaScriptSerializer().Serialize(list) + "}"; response.Output.Write(json); }
//获取所有课程信息 public void getList(HttpContext context) { HttpResponse response = context.Response; int page = Int32.Parse(context.Request["page"]); int size = Int32.Parse(context.Request["rows"]); String json = ""; CourseModel coursemodel = new CourseModel(); List<Bap_Course> list = coursemodel.list(page, size); int total = coursemodel.count(); response.ContentEncoding = UTF8Encoding.UTF8; response.ContentType = "text/plain"; json = "{\"total\":" + total + ",\"rows\":" + new JavaScriptSerializer().Serialize(list) + "}"; response.Output.Write(json); }