I've written a jQuery demo to post JSON:
$.ajax({
url: "RoleFunc.aspx/Vonvert",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: { "strJson": json },
success: function(result) {
alert(result);
},
error: function() {
alert("error");
}
});
and when I use the function, Firebug view shows as an error message like Invalid JSON primitive: strJson.
I've tested the JSON and the result is
{ "strJsonssss":[{"Role_ID":"2","Customer_ID":"155","Brands":"Chloe;","Country_ID":"96;"}]}
and my C# func is
[WebMethod]
public static int Vonvert(string strJson)
{
//DataSet dt1 = JsonConvert.DeserializeObject<DataSet>(strJsonssss);
return 1;
}
I debug it, and it never in to the function so... any body help me...