I'm using IE 10, Firefox 24, Chrome 29.
I have a server running on ASP.NET MVC 4 (IIS 8), with a simple function in the controller:
[HttpPost]
public ActionResult Register(string PhoneNumber, string DisplayName)
{
// Some commented code here ...
ViewBag.Message = "Working!";
return View();
}
The view looks like:
@{
ViewBag.Title = "Register";
}
@ViewBag.Message
The Ajax call looks like:
$.ajax({
type: "POST",
url: "http://localhost:1283/home/Register",
data: {
phoneNumber: "123",
displayname: "Miko"
},
success: function (response) {
alert("In success: " + response);
},
error: function (result) {
alert('In error: '+ result);
}
})
In all browsers, the AJAX call is made, the Register() in the server is fired, but after it's done, this code works fine in Internet Explorer, but always goes to 'error()' using Firefox\Chrome.
How can I make the functions work for Firefox and Chrome as well ?
Thanks.