I want to call a method in C# from a client side AJAX/JQuery message. The client code is:
function TestClickFunc(userId) {
$.ajax({
url: "/Users/UpdateEmailDistributionListFlag",
type: "POST",
data: { "userId" : userId },
success: function (data) { alert(data); }
});
}
This method gets called with the correct parameter. However in my UsersController, this method does not get called;
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateEmailDistributionListFlag(int userId)
{
// db update
return View();
}
Can you see why?