Asp.net-mvc – Html.BeginForm() with GET method

asp.net-mvcasp.net-mvc-3forms

How can I specify that my form should be using GET method with @Html.BeginForm() ?

@using (Html.BeginForm(method: FormMethod.Get))

Here VS complains that best overload doesn't have a parameter method. Thank you!

Best Answer

There is an overload that allows you to specify the method:

@using (Html.BeginForm("someAction", "someController", FormMethod.Get))
{
    ...
}