The jQuery posting event is
<script>
$(document).ready(function () {
$("#going").click(function () {
$.post("/Home/ToggleGoing",
{
going: $("#going").val()
},
function (data) {
//No success code.
});
});
});
</script>
And the action in control is
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult ToggleGoing(bool going, int? id)
{
var e = db.Events.FindAsync(id);
However, the javascript console shows it got 500 error?
POST https://localhost:44300/Home/ToggleGoing 500 (Internal Server Error)