I’m learning MVC and ASP.NET. I have a table in which the last column contains an Edit button for each row. This works fine and I like the look and feel of the button vs a link, but when it opens the page, the HttpPost action is called in the controller. I understand why this is happening, its a submit button, and its acting like that page is being submitted. How do I modify this so that I have a button that redirects to a HttpGet for that page? (In Razor …)
@using (Html.BeginForm("Update", "Purchase"))
{
@Html.HiddenFor(x => x.Id)
<input type="submit" value="Update" />
}
Add
FormMethod.Getto theBeginForm()parameters.