i have a doubt in jquery ajax data format. what is the data type of user data when passing from client to server? . if data is passing like data: { // user data} giving 500 error. but if passing like data:'{}' or data:"{}" giving result as success. do i need to enclose the data between '' or "" ?
$.ajax({
type: "POST",
url: "Contact.aspx/add",
dataType: "json",
data: '{ "Data": "hii" }',
contentType: "application/json; charset=utf-8",
success: function (response) {
},
error: function (msg) {
alert(msg.status);
}
});
------c#-------
[WebMethod]
public static void add(string Data)
{
}