DataTables not responding after conversion to MVC2.

DataTables not responding after conversion to MVC2.

rterrilrterril Posts: 2Questions: 0Answers: 0
edited March 2010 in General
Last fall our company started a major project to re-engineer our administrative web application. It contains approximately 50 web pages, many of which contain lists. We plan to use DataTables for all our list pages. We started using MVC 1.0 and we were having success with DataTables and were pleased with our results. At this time, we have successfully proto-typed four of the web pages that will use DataTables. Recently we decided to convert to DataTables 1.6.2 and to MVC 2.0 before continuing with development. The conversion to DataTables 1.6.2 was simple and successful. Unfortunately, after converting to MVC 2.0, Data Tables no longer displays the tables. It does not display the tables for either server-side or client-side processing. I have break points in the controller method that builds the Json object and can see it being built and the method ending successfully, but the table never displays and the "Acquiring Data" message remains displayed on the page. I would appreciate any help I can get and can provide additional information if required.

Replies

  • rterrilrterril Posts: 2Questions: 0Answers: 0
    This issue was solved with a change to how the Json object was returned by the MVC 2.0 controller. The return requires a second parameter (see below) that overrides MVC 2.0 default behavior and allows the Json object to be returned for "GET" requests.

    return Json(jsonData, JsonRequestBehavior.AllowGet);
This discussion has been closed.