I am using jQuery Ajax method with Asp.net MVC 3.0
My jQuery Code is
$.ajax({
type: "POST",
url: "/HomePage/GetAllCategories",
contentType: "application/json; charset=utf-8",
dataType: 'json',
success: function (result) {
alert(result);
}
});
And my Action Method is
public JsonResult GetAllCategories()
{
return Json(null, JsonRequestBehavior.AllowGet);
}
I am getting the Error
POST http://localhost:50500/HomePage/GetAllCategories 405 (Method Not Allowed)
My debugger is not hitting this method.