i think your are binding the html in wrong way..
..<option value='" + result.VoyageMasterID + "'>"...
//--^^^^^^^^^^^^^^^^---here looks like you have a response as JSON..
try this
$.ajax({
type: "POST",
...
dataType: "json", //here get response as json
.....
});
and make sure you send the response as JSON in your controller (which i think you are already doin it).. changing the dataType as JSON should work..
updated
your json
{ "Table": [ { "VoyageMasterID": 3, "VoyageCode": "9101" }, { "VoyageMasterID": 3, "VoyageCode": "9101" }]}
try this
function Success(result) {
alert("SUccess Called");
$(".ddlVoyage").empty();
$(".ddlVoyage").append("<option value=''>Select </option>");
$.each(result.Table, function (index, value) {
$(".ddlVoyage").append("<option value='" + value.VoyageMasterID + "'>" + value.VoyageCode + "</option>");
});
}
since you json is in array of objects.. you have to loop through result.Table(your object's name is table) and get its correspoding voyagemasterid and voyagecode