I have a response 404 from controller on submit simple form.
javascript:
var FunctionName= function () {
var form = $("#formId").serialize();
form.validate();
if (form.valid()) {
$.ajax({
url: "/Cliente/Register",
data: form,
type: "POST",
success: function (data) {
if (data.success) {
//todo
}
else {
//todo
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$(".LoginMessage").html("Erro");
alert("Status: " + textStatus); alert("Error: " + errorThrown);
}
});
}
}
Controller:
[HttpPost]
public JsonResult Register(FormCollection values)
{...}
When I remove the action filter "[httpPost]" the system finds the method, someone help me please...
404is Not found error. That means he cannot find/Cliente/Register. make sure url is written correctly