I've encountered a peculiar issue. When I run my Visual Studio and click on a specific button in the browser, an ajax function is triggered but displays an error. After some debugging, I discovered that the URL is causing the problem:
POST http://localhost:4942/Employee/Employee/AllEmployees 404 (Not Found)
The puzzling part is that for some unknown reason, the "/Employee" controller is appearing twice.
Here's the ajax call:
function allEmployeeFunc() {
$.ajax({
type: "POST",
url: "Employee/AllEmployees",
//data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
// context:"" ,
error: function (msg) {
alert("something is wrong");
},
success: function (data) {
}
});
}
The URL clearly shows only one occurrence of /Employee. So, what could be causing this issue? Any assistance would be greatly appreciated.