Will the error be displayed?
Posted
by user281180
on Stack Overflow
See other posts from Stack Overflow
or by user281180
Published on 2010-05-24T10:30:00Z
Indexed on
2010/05/24
10:41 UTC
Read the original article
Hit count: 117
asp.net-mvc
I have an ajax post and in the controller I return nothing. In case there is a failure will the error message displayed with the follwoing code?
[AcceptVerbs(HttpVerbs.Post)]
public void Edit(Model model)
{
model.Save();
}
$.ajax({
type: "POST",
url: '<%=Url.Action("Edit","test") %>',
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "html",
success: function() {
},
error: function(request, status, error) {
alert("Error: " & request.responseText);
}
});
© Stack Overflow or respective owner