MY CODE WORK ON GET METHOD BUT POST NOT WORK IN MVC5
$.ajax({
type: "POST",
url: "http://localhost:49290/api/admin/adminlogin",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
var data = JSON.parse(response.d);
var userid=data[0].userid;
if (data.length > 0) {
location.href = "Dashboard.aspx?userid='" + userid + "'";
}
else {
$.iaoAlert({
msg: "Username and Password Not Match...",
type: "error",
mode: "dark",
})
this1.disabled = false;
this1.innerHTML = 'SIGN-IN';
}
},
failure: function (response) {
$.iaoAlert({
msg: "404 Error",
type: "error",
mode: "dark",
})
this1.disabled = false;
this1.innerHTML = 'SIGN-IN';
},
error: function (response) {
$.iaoAlert({
msg: "406 Error",
type: "error",
mode: "dark",
})
this1.disabled = false;
this1.innerHTML = 'SIGN-IN';
},
});
return false;
[HttpPost]
[Route("api/admin/adminlogin")]
public IHttpActionResult adminlogin(string CusName)
{
return Ok("Find");
}