I managed to install a simple web method that I called from jquery and of course it returns ... then I added parameters to this method and added parameters to jquery, but these are errors with
Message":"Invalid JSON primitive: one.","StackTrace":"
my signature on my web method is like
[WebMethod] public static string GetDate(string one, string two) { return "yes"; }
and my jquery like this, what am I doing wrong?
$.ajax({ type: "POST", url: "MyService.aspx/GetDate", data: { one: "value", two: "value" }, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { alert(msg.d); }, error: function(msg) { alert('error'); } });
source share