@using System.Web.Optimization
@model IEnumerable<DataTablesMvc4.Models.DataTablesWithJson>
 
@section scripts {
 
    @Styles.Render("~/Content/themes/base/css")
    @Scripts.Render("~/bundles/table")
 
    <script type="text/javascript">
        $(document).ready(function () {
            var oTable = $('#myDataTable').dataTable({
                "bProcessing": true,
                "bServerSide": true,
                "sAjaxSource": "AjaxHand",
                "fnServerData": function (sUrl, aoData, fnCallback, oSettings) {
                    oSettings.jqXHR = $.ajax({
                        "type": "POST",
                        "url": sUrl,
                        "data": aoData,
                        "success": fnCallback,
                        "dataType": "json",
                        "cache": false
                    });
                },
                "aoColumns": [
                    { "sWidth": '200px', "mData": "Name" }
                ]
            });

        });
    </script>
}
 
@{
    ViewBag.Title = "Index";
}
 
 
<h2>Index</h2>
 
<table id="myDataTable">
     
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
        </tr>
    </thead>
     
    <tbody>
    </tbody>
     
    <tfoot>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
        </tr>
    </tfoot>
 
</table>