I have problem encountered in using $.getJSON
because I always get error "Request format is unrecognized for URL unexpectedly ending in '/GetBranches'
"
Here is my code:
$.getJSON('testWS.asmx/GetBranches', function (data, status, xhr) {
console.log(data);
});
Here is the code for the web service
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public List<BranchesModel> GetBranches()
{
return BranchesBLL.Instance.GetBranches();
}
What is wrong with my URL? How can I possibly fix this issue so that I can use $.getJSON function?