I would like to have my form do a Get rather than a Post (It's a query field the user is submitting)
I know I can do it with
<% using(Html.BeginForm(action, controller, FormMethod.Get) {%>
However, I would rather not have to specify the action/Controller and there doesn't seem to be an overload that takes FormMethod only.
This is MVC 1.0 (and without the futures)
There is no such overload in the framework. However, if you send in action and controller as null
the framework will do what you want. If you don't like that you can create that extension yourself:
public static MvcForm BeginForm(this HtmlHelper htmlHelper, FormMethod method) {
return htmlHelper.BeginForm(null, null, method);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With