We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MVC Grid Json mode not working

Thread ID:





90810 Oct 19,2009 06:15 PM UTC Jun 1,2012 07:27 AM UTC ASP.NET MVC (Classic) 5
Tags: Grid
William B. Morrison
Asked On October 19, 2009 06:15 PM UTC

I've got the MVC grid working well in Server mode but can't get it to work properly in Json mode. Snippets of the code is below - note the Ajax Post near the end - that returns the data properly from the Action used as the paging Action so the data is coming back from the Controller just fine. When I use FireBug to debug it everything looks fine from a data standpoint. The problem is that when I click on a page number or any other element from the pager, I get the spinning circle that tells me that it's working but it never comes back from it. It appears that it should be caused by some missing JavaScript but I have everything referenced from the demo, I believe.

I couldn't get this to work properly using our infrastructure so I scaled back and used a simple model class and just return instances of it. I'm including:

- The test entity
- The controller
- The CSS and JavaScript references
- The Ajax post code showing that the data comes back from the controller properly
- The grid template from the view

I've looked at this next to the demo code that came with the MVC controls. I don't see anything that jumps out at me - I just want to know what would be causing the behavior noted (the spinning circle starts, the data comes back from the controller as noted in the debugger but the spinning circle never goes away). It is not a pause in the debugger as this happens whether or not I'm in IE and whether or not FireBug is active.

Thx in advance for any help you can give...

public class TestEntity
public int Id { get; set; }
public string Name { get; set; }

public class HelpDeskController : Controller
public ActionResult Index()
GridPropertiesModel model = new GridPropertiesModel()
DataSource = GetInitialGridData(DatabaseSession),
Caption = "Test Entities",
PageSize = 10,
PageCount = 6,
JSONModePagingSortingMapper = "/Home/GridJSONAction",
ActionMode = "JSON",
ItemTemplate = "BrowseTemplate",
AllowPaging = true,
AllowSorting = false,
PrimaryKeyColumns = { "Id" },
HeaderText = { "Id", "Name"}
ViewData["GridModel"] = model;
return View();

public ActionResult GridJSONAction(PagingParams args)
List l = new List();
for (int i = 1; i <= 10; i++)
l.Add(new TestEntity() { Id = args.StartIndex + i, Name = "Name " + (args.StartIndex + i) });

return Json(l);

private List GetInitialGridData()
List l = new List();
for (int i = 0; i < 1000; i++)
l.Add(new TestEntity() { Id = i, Name = "Name " + i });
return l;

<%=Html.Grid("BrowseWorkOrdersGrid", "GridModel", column =>{
column.Add(p => p.Id);
column.Add(P => P.Name);

" rel="stylesheet" type="text/css" />
" rel="stylesheet" type="text/css" />

$(document).ready(function() {

$.post("/Home/GridJSONAction", { StartIndex: "15" },
function(data) {
alert("Data Loaded: " + data);



Balaji M [Syncfusion]
Replied On October 30, 2009 06:38 AM UTC

Hi William,

Sorry for the delay response.

I am afraid that I am unable to reproduce the reported issue. I have created a simple sample to test this issue and I am able to navigate the page the Grid in JSON MODE successfully and the sample is available from below link.


Please ensure the below details in your application,

1.Place the following three scripts files in separate folder under scripts folder.
* MicrosoftAjax.js,
* MicrosoftAjaxAdoNet.js,
* MicrosoftAjaxTemplates.js

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Please let me know if you have any concerns.

M. Balaji.

Praveen Matoria
Replied On May 30, 2012 07:10 AM UTC


I think above mentioned link is dead: files.syncfusion.com/support/grid_mvc/Incidents/F90810/MVC_JSONGrid.zip

So, could you update the link or send me file at my email ID ASAP.

Basically, i require a MVC Grid with ActionMode = json.


Bala Murugan A.S [Syncfusion]
Replied On May 31, 2012 05:09 AM UTC

Hi Praveen,

Thanks for using Syncfusion Products.

We have prepared a simple sample that demonstrate the JSON Mode in Syncfusion Essential Grid and the sample can be downloaded from the below link.


To know more about the JSON Mode please refer the below links:

Documentaion link:

Online Samples:

Editing: http://mvc.syncfusion.com/sfmvcsamplebrowser/





Please try the above sample and let us know if you have any concerns.

Bala Murugan A.S

Praveen Matoria
Replied On May 31, 2012 10:46 AM UTC

I got it working. The was that the latest build has some issue with DLL's. So, JSON mode was not working with it. My Team  had older version of it and it worked with it. Please verify that your latest Grid DLL's works fine with ActionMode="JSON"

Bala Murugan A.S [Syncfusion]
Replied On June 1, 2012 07:27 AM UTC

Hi Praveen,

Thanks for your update.

The ActionMode property has been changed from a string to an ActionMode enum in the  version 9.1 and later version. Please refer the release notes from the below link.


Please have a look at the release notes and let us know if you have any concerns.

Bala Murugan A.S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon