当我的控制器从控制器返回我的json数据时,
_yonetimRepo.Uniler();
IList<YonetimModel.Universiteler> Uniler = _yonetimRepo.Uniler();
return Json(new { data = Uniler }, JsonRequestBehavior.AllowGet);
这是我的html:
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Id</th>
<th>Üniversite</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Id</th>
<th>Üniversite</th>
</tr>
</tfoot>
<script>
$(document).ready(function () {
$('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "Home/Yonet",
"type": "POST"
},
"columns": [
{ "data": "Id" },
{ "data": "Universite" }
]
});
});
毕竟我只是在html页面上将结果作为json数组,不能将数据推送到数据表中,请帮助我解决这个问题