Hi,
I use the protocol jsonp to call web methods, but i have this problem:
Have this code on the webservice:
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod]
public string HelloWorld()
{
return "Hello World";
}
}
And this on Jquery with jason on client side:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: 'http://localhost:50837/Service1.asmx/HelloWorld',
data: {},
dataType: "json",
success: function(Msg) {
alert('success:' + Msg.d.FirstName);
},
error: function(xhr, textStatus, errorThrown) {
alert("error");
}
});
}
This Jquery give me always the error message i dont know the reason. Someone can help me?