I considered several solutions for creating an ajax call and did not mention this problem anywhere, I feel that it may be something specific to the environment with which I work. My controller:
[HttpPost]
public ActionResult ChangeDefualtCC(string a)
{
return Json("ok");
}
[HttpGet]
public ActionResult ChangeDefualtCC()
{
return Json("ok");
}
JS:
$("nevermind").change(function () {
$.ajax({
type: "POST",
url: "/Account/ChangeDefualtCC",
dataType: "json",
data: {
a: "A"
},
success: function (data) { console.log(data)},
error: function (data) { console.log("error");}
});
});
Controller code never gets in, and this is what I see in chrome after ajax call:
EDIT 2: The page falls into the [HttpGet] method.

EDIT: I also noted Ektron because it is used in the project, and it is possible that this affects the call.
My routes:

Update . I tried using Get as well as Post, and also returning to the view I was in, I get 302 every time.
any ideas?
edank source
share