Can you help me understand why my JavaScript code only calls my webservice when I set a breakpoint on the line ].getJSON, but not if I remove the breakpoint?
$(function () {
$("#" + @Model.BidObjectId).submit(function () {
alert("Test");
$.getJSON("http://localhost:11523/Service1.svc/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="400725340229240f222a2523347f29247d000d2f24252c6e0229240f222a2523340924">[email protected]</a>", function (data) {
alert(data)
});
});
});
The test alert always shows up, but the breakpoint in my svc file is never reached unless I put a JavaScript breakpoint in Chrome on the line ].getJSON...
Here is the code in my webservice
public List<BidObject> GetBidObject(string id)
{
List<BidObject> list = new List<BidObject>();
list.Add(new BidObject() { BidObjectId = 1, Title = "Name" + id, Date = DateTime.Now });
return list;
}
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "/GetBidObject?id={id}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
List<BidObject> GetBidObject(string id);