diesen Fehler Got während versuchen, mein Controller-Methode aufzurufen (Controller-Name ist ProductsController
):Aufruf Controller-Methode über Ajax reach "404 not found"
public ActionResult GetProducts()
{
return false;
}
Telefonvorwahl wie folgt aus:
$(document).ready(function() {
$.ajax({
type: 'POST',
url: '@Url.Action("GetProducts", "ProductsController")',
dataType: 'json',
cache: false,
contentType: 'application/json; charset=utf8',
data: JSON.stringify(""),
})
Konsole in Chrome sagt:
jquery-1.10.2.js: 8720 POST http : // localhost: 56408/ProductsCon Troller/GetProducts 404 (nicht gefunden)
Haben Sie eine Idee, was ist das Problem?
Verwenden Sie einfach das Controller-Name-Präfix 'Products' anstelle von' ProductsController' – Nkosi