I'm guessing is very simple, but I'm learning MVC 2 right now and I'm stuck. I've got strongly typed view with some fields and buttons which should change something in database by click on them. So it is code
<% using (Html.BeginForm("UpVote", "Home",FormMethod.Post,new { linkId = link.LinkID }))
{%>
<input type="submit" value="UP" />
<% } %>
And my controller
[HttpPost]
public void UpVote(int linkId)
{
var updateLink = geekDB.Link.Single(a => a.LinkID == linkId);
updateLink.UpVotes++;
geekDB.SaveChanges();
RedirectToAction("Index");
}
And it doesn't work. When i press button, page is reloaded but nothing happens. I checked it with breakpoint in UpVote method but it never stop there and I have no idea why.