Alex Rivera | Logout

Html.BeginForm() with GET method

Asked 2011-09-23T19:32:01.083
22

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!

Edit
Report

1 Answer

39

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

@using (Html.BeginForm("someAction", "someController", FormMethod.Get))
{
    ...
}
answered 2011-09-23T19:35:30.430

Your Answer