I have the follwing method
[WebMethod]
[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
public List<MyObject> GetMyObjects()
{
return Business.GetMyObjects();
}
as you can see the web method is set to JSON but the method is returning XML
I am using the following JavaScript to access this web method.
function getMyObjects() {
$.ajax({
type: "POST",
url: "/treenode/myobjects.asmx/GetMyObjects",
dataType: "JSON"
}).success(function(data) {
var response = data.d;
alert(d.param);
});
}
This may well be a quick fix but I am missing something and cant see what it is.