Below would be the function/method from the controller:
public ModelVoucherLogs getDetails(int id)
{
VoucherHistoryManager manager1 = new VoucherHistoryManager();
var m = manager1.FindAll()
.Where(a => a.ID == id)
.Single();
VoucherLogsManager manager = new VoucherLogsManager();
ModelVoucherLogs model = manager.FindAll()
.Where(a => a.VoucherNo.Equals(m.VoucherNo) &&
a.TransactionType.Equals("CONSUMED"))
.Single();
return model;
}
This would be the JavaScript function:
function getDetails(id) {
var modal = document.getElementById('details_modal');
modal.style.display = "block";
$.ajax({
type: "POST",
url: "Main/getDetails?id=" + id,
success: function (model) {
}
});
}
How do I get the values of the model individually.
Sample: Let's just say the model has Voucher ID, Transaction Type, etc.
How do I get that value of those.