MVC-Ajax-Post-to-Controller-Aktionsmethode

Ich habe mir die Frage hier angeschaut:MVC-Ajax-Json-Post-to-Controller-Aktionsmethode aber leider scheint es mir nicht zu helfen. Meins ist ziemlich genau dasselbe, mit Ausnahme meiner Methodensignatur (aber ich habe es versucht und es wird immer noch nicht getroffen).

jQuery
$('#loginBtn').click(function(e) {
    e.preventDefault();

    // TODO: Validate input

    var data = {
        username: $('#username').val().trim(),
        password: $('#password').val()
    };

    $.ajax({
        type: "POST",
        url: "http://localhost:50061/checkin/app/login",
        content: "application/json; charset=utf-8",
        dataType: "json",
        data: JSON.stringify(data),
        success: function(d) {
            if (d.success == true)
                window.location = "index.html";
            else {}
        },
        error: function (xhr, textStatus, errorThrown) {
            // TODO: Show error
        }
    });
});
Regler
[HttpPost]
[AllowAnonymous]
public JsonResult Login(string username, string password)
{
    string error = "";
    if (!WebSecurity.IsAccountLockedOut(username, 3, 60 * 60))
    {
        if (WebSecurity.Login(username, password))
            return Json("'Success':'true'");
        error = "The user name or password provided is incorrect.";
    }
    else
        error = "Too many failed login attempts. Please try again later.";

    return Json(String.Format("'Success':'false','Error':'{0}'", error));
}

Egal was ich versuche, meineController wird nie getroffen. Durch das Debuggen weiß ich, dass es eine Anfrage sendet, es bekommt nur eineNot Found Fehler jedes Mal.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage