I want my razor view to look something like this
@Ajax.ActionLink("A", "Buy", new AjaxOptions() { HttpMethod = "Post", OnSuccess = "updateLetter" }, new { id = "letter-A" })
@Ajax.ActionLink("B", "Buy", new AjaxOptions() { HttpMethod = "Post", OnSuccess = "updateLetter" }, new { id = "letter-B" })
@Ajax.ActionLink("C", "Buy", new AjaxOptions() { HttpMethod = "Post", OnSuccess = "updateLetter" }, new { id = "letter-C" })
and my javascript to look something like this
function updateLetter(letter)
{
$("#letter-" + letter).toggleClass('selected');
}
the idea being that if I click the A link, it'll do the ajax and toggle the class on that element. I'm not sure exactly how to hook it up though. What am I missing?