I really cannot find any sample how to convert List<object> to Json format and populate <tbody> in C#?
List result = new List ();
MyClass m1 = new MyClass();
MyClass m2 = new MyClass();
result.Add(m1);
result.Add(m2);
return Json(???);
$.post("/Tradeshow/AddTradeShowDetail", {
startdate: $('#cstartdate').val(),
enddate: $('#cenddate').val(),
location: $('#clocation').val(),
speakerid: $('#TradeshowSpeakers').val(),
isnonspeaker: value
},
function (data) {
if (data.length > 0) {
// Populate <tbody> ???
}
});
action
js
Check if the list is in
data.dwhen it comes back. If not, just processdata