Tuesday, November 18, 2014

Posting JSON data via jQuery to ASP .NET MVC 4 controller action not working

The grid data if I want to save data in json call then if the json data cross the limit of JsonDeserializer then it will not work on controller action. 

  function SaveMenuPrivilege() {  
     var postUrl;  
     var paramValue;  
     var gridData = $("#MenuPrivilegeKendoGrid").data("kendoGrid").dataSource.data();  
     // set model data   
     for (var i = 0; i < gridData.length; i++) {  
       gridData[i].NewRoleId = $("#RoleId").val();  
     postUrl = '@Url.Content("~/Admin/MenuPrivilege/SaveMenuPrivilege")';  
     paramValue = JSON.stringify({ MenuPrivilegeList: gridData }); // you can also set model data using','   
       url: postUrl,  
       type: 'POST',  
       dataType: 'json',  
       data: paramValue,  
       contentType: 'application/json; charset=utf-8',  
       success: function (result) {  
       error: function (objAjaxRequest, strError) {  
         var respText = objAjaxRequest.responseText;  

   public ActionResult SaveMenuPrivilege(MenuViewModel menuViewModel)  

 To resolve this problem you just need to add in your web config appsetting

  <add key="aspnet:MaxJsonDeserializerMembers" value="50000000" />

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link. http://www.microsoft.com/download...