Skip to content Skip to sidebar Skip to footer

Json Data Table Passing Failed

My AJAX is not working but my JSON result is return row count is 12 and it is not showing any alert messages. I check in browser, it shows 500 internal server error. If checking pu

Solution 1:

Well not get exact problem, but see below code which work as I wish in my case...

Jquery

$.ajax({
       type: "POST",
       url: "url",
       data: "jason-data",
       contentType: "application/json; charset=utf-8",
       dataType: "json",
       success: function(msg) {
              var t = window.JSON.parse(msg.d);
              // Your code.
        }
});

c# code

[WebMethod]
publicstaticstringSendMessage()
{
      // Code // return new JavaScriptSerializer().Serialize();
}

Make sure jason key datatype and it's name same as the argument name of method called ba parameters....

Solution 2:

try to Use the ajax post as::

$.ajax({
    type:'POST',
    Url:"GroupFix",
    data:{id=2,name='TestName'},
    success:function(data){

       for(int i=0;i<data.length;i++){
             alert('name');
        }
    }
})

Post a Comment for "Json Data Table Passing Failed"