I'm using web service and trying to pass a json object and my ajax in the fron end doesn't receive it. It says it was a success but there is nothing in the response object. I've tried everything I can think of and still nothing.
Web Service
rt = "{'RegistrationTypeID':'" + regType.RegistrationTypeID + "'}";
string json = JsonConvert.SerializeObject(rt);
return json;
Javascript
$.ajax({
type: "POST",
url: "/static/svc/RegistrationForm.asmx/GetRegistrationType",
timeout: 0,
success: function (response, status) {
console.log("status: " + status);
var types = response;
console.log("types: " + types);
$.each(types, function (index, value) {
console.log("In loop");
$('select').append('<option value="' + value.RegistrationTypeID + '">' +
value.RegistrationTypeName + '</option>');
});
},
error: function (response) {
console.log(response),
console.log(response.statusCode);
console.log(response.statusText);
}
});