I am trying to call a webservice on my local host which expects a parameter pkId and return the result. WebService runs perfect but when i call from JQuery, it does not return any data. I have tried almost all combinations to set parameter for the Web service (data) part but unable to get any result and the real pain is i don't get any error.
$.ajax({ type: "POST", url: "http://localhost/WSTest/Service.asmx/AuthorGetById", data: "{pkId :'" + pkId + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { return msg.d; } });
[System.Web.Script.Services.ScriptService]in you webmethod for ajax call ?