Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            string page = CreatePagination.ShowPageNavigate(15, 2, 616);

            context.Response.Write(page);
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            List <Model.StudScoreInfo> scoreList = new List <Model.StudScoreInfo>();

            BLL.StudScoreInfo scoreServer = new BLL.StudScoreInfo();
            int    pageSize     = 12;
            int    pageIndex    = int.Parse(context.Request["pageIndex"].ToString());
            int    totalCount   = scoreServer.GetRecordCount(string.Empty);
            string pagination   = CreatePagination.ShowPageNavigate(pageSize, pageIndex, totalCount);
            var    scoreDataSet = scoreServer.GetListByPage(string.Empty, string.Empty, (pageIndex - 1) * pageSize, pageIndex * pageSize);

            scoreList = scoreServer.DataTableToList(scoreDataSet.Tables[0]);
            var    scoreListAndJson = new { studList = scoreList, pagination = pagination };
            string json             = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(scoreListAndJson);

            context.Response.Write(json);
        }