Get Warning: Ajax error after publish

Get Warning: Ajax error after publish

frosty8467frosty8467 Posts: 4Questions: 3Answers: 0

I have an MVC app that I have created. Everything works fine in debug mode.

After I publish the app to a file location and then add that location as an Application in IIS on the same server, I start to get this error
DataTables warning: table id=tblData - Ajax error. For more information about this error, please see http://datatables.net/tn/7

I have checked the console and it is returning a 404 error but I can't figure out why.

Here is the Java script I call
var dataTable;

$(document).ready(function () {
loadDataTable();
});

function loadDataTable() {
dataTable = $('#tblData').DataTable({
"ajax": {
"url": "/Admin/Status/GetAll"
},
"columns": [
{ "data": "name", "width": "60%" },
{
"data": "id",
"render": function (data) {
return <div class="text-center"> <a href="/Admin/Status/Upsert/${data}" class="btn btn-success text-white" style="cursor:pointer"> <i class="fas fa-edit"></i> </a> <a onclick=Delete("/Admin/Status/Delete/${data}") class="btn btn-danger text-white" style="cursor:pointer"> <i class="fas fa-trash-alt"></i> </a> </div> ;
}, "width": "40%"
}
]
});
}

New to MVC and Web applications so quite possible it is something in the publishing phase but any help greatly appreciated.

Answers

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736

    Don't know anything about MVC but the 404 error is coming from the server because it can't find the URL path. You will need to look at the server logs to troubleshoot the issue.

    Kevin

Sign In or Register to comment.