I'm trying to call a server side function from ajax but keep getting this error
Invalid web service call, missing value for parameter: \u0027name\u0027.
here is the js code
var obj = { name: name, company: company, country: country, email: email, msg: Msg }
var json = JSON.stringify(obj);
$.ajax({
method: "GET",
url: "ContactUs.aspx/SendEmail",
contentType: "application/json; charset=UTF-8",
data: json,
dataType:"json",
success: function (data) {
var a = 3;
},
error:function(a,b){
var a = 43;
}
})
and here is the c# webmethod
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public static string SendEmail(string name, string company, string country, string email, string msg)
{
return string.Empty;
}
the names are identical between the js and c# vars and all of my vars have values.
thanks in advance