Here's my jquery:
$.ajax({
type: 'GET',
url: '/services/Service.asmx/FamilyHistory',
data: JSON.stringify({
userID: 10,
historyID: famid
}),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function(val) {
var famHist = val.d;
alert(famHist.ID);
},
error: function() {
parent.$.jGrowl('<b>Failed</b>',
{
header: 'User Action:',
life: 3000
});
}
});
My Class:
public sealed class FamilyHistoryEntity
{
public string ID { get; set; }
public string RelativeName { get; set; }
}
My Web service:
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
public FamilyHistoryEntity FamilyHistory(int userID, string historyID)
{
return GetFamilyHistory(historyID, userID); // returns a FamilyHistoryEntity class
}
Problem is, i can't even make it do a breakpoint onto the webservice, it just throws the jquery ajax event of error.