.NET application, how do I construct a proper Json string?

.NET application, how do I construct a proper Json string?

jStonejStone Posts: 4Questions: 2Answers: 0

I just inherited a project using DataTables that has minimal commenting and original developer not available.

The project is a .NET MVC framework website and I'm trying to understand what is going on with the code in a controller.

I've cut almost all the goodies out of the following code block that works:

        public ActionResult MyDataTable()
        {
              var result;
              //get data, manipulate and stuff in result
                    return Json(new
                    {
                        Result = "Success",
                        iDisplayStart = 5,
                        sEcho = 1,
                        iTotalRecords = 2,
                        iTotalDisplayRecords = 2
                        ,  aaData = result
                    }, JsonRequestBehavior.AllowGet);
        }

My question is what are iDisplayStart, sEcho, iTotalRecords, and iTotalDisplayRecords? And why are they hard coded?

Did the previous developer try to over-write the number of records, start page, etc to display?

Any help in understanding what just happened would be greatly appreciated.

Replies

This discussion has been closed.