MVCコントローラーからJsonとして返されるオブジェクトのリストがあります。このオブジェクトをビューに表示する方法を考えています。
function GetTabData(xdata) {
$.ajax({
url: ('/Home/GetTabData'),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ id: xdata }),
success: function (result) {
/// what to do here?
},
error: function () { alert("error"); }
});
}
public JsonResult()
{
...
var temp = getMyData...
return Json(temp, JsonRequestBehavior.AllowGet);
}
ページを見る
<div id="showContent"> </div>