Sagar Bandkar

Sagar Bandkar

  • 1.4k
  • 347
  • 48.9k

Data value get Null in ajax action

Jan 20 2017 5:05 AM
 
function GetStatusDetails(id) {
$.ajax({
url: '@Url.Action("GetStatusDetails","GenerateMemo")',
type: "GET",
data: { "id": id },
datatype: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
alert(data.vcMemSubject);<-------------------------get Null
if (data != null) {
$("#signature").val(data.vcMemSigunature);
$("#subject").val(data.vcMemSubject);
$("#body").val(data.vcMemText);
}
},
error: function (e) {
//alert(e.data);
}
});
}
 
 
 
 
[HttpGet]
public tblMstMemo_MEM GetStatusDetails(int id)
{
try
{
if (id > 0)
{
tblMstMemo_MEM statusDetails = db.tblMstMemo_MEM.Find(id);
return statusDetails;
}
}
catch (Exception ex) { ex.Message.ToString(); }
return null;
}
 

Answers (1)