I am having a jquery datatable which is working fine when i am trying to run locally, but when i am publishing it in iis it shows error.
Error:
DataTables warning: table id=LandResource - Ajax error. For more information about this error, please see http://datatables.net/tn/7
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
@{
//Layout = null;
Layout = "~/Views/Shared/_LayoutPage1.cshtml";
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div class="container" style="margin-top:80px">
<table id="LandResource" class="ui celled table">
<thead>
<tr>
<th>S.No</th>
<th>CPSE Name</th>
<th>State</th>
<th>Unit</th>
<th>Status</th>
<th>Land FreeHold Mutated</th>
<th>Land FreeHold Non-Mutated</th>
<th>Land Lease Hold</th>
<th>Land Total</th>
</tr>
</thead>
</table>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.semanticui.min.css" />
@section Scripts{
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.semanticui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.js"></script>
<script>
$(document).ready(function () {
$('#LandResource').DataTable({
"ajax": {
"url": "/Reports/LoadData",
"type": "GET",
"dataType": "json"
},
"fnRowCallback": function (nRow, aData, iDisplayIndex) {
var oSettings = this.fnSettings();
$("td:first", nRow).html(oSettings._iDisplayStart + iDisplayIndex + 1);
return nRow;
},
"columns": [
{ "data": null, "autoWidth": true },
{ "data": "CPSE_id", "autoWidth": true },
{ "data": "CPSE_StateName", "autoWidth": true },
{ "data": "CPSE_Unit_Name", "autoWidth": true },
{ "data": "Land_Status", "autoWidth": true },
{ "data": "LandFreeHold_Mutated", "autoWidth": true },
{ "data": "LandFreeHold_NonMutated", "autoWidth": true },
{ "data": "LandLeaseHold", "autoWidth": true },
{ "data": "LandTotal", "autoWidth": true }
]
});
});
</script>
}
</body>
</html>