Why is my asp.net mvc form POSTing instead of GETting?
- by quakkels
My code is straightforward enough:
<% using(Html.BeginForm(FormMethod.Get)) %>
<% { %>
Search for in Screen Name and Email: <%: Html.TextBox("keyword", Request.QueryString["keyword"]) %>
<button type=submit>Search</button>
<% } %>
The issue I'm running into is that when I submit this form, the values are not added to the querystring. Instead, it appears that the form is submitting by a post request. When I look at the generated HTML, I have this:
<form action="/find/AdminMember/MemberList" method="post">
Search for in Screen Name and Email: <input id="keyword" name="keyword" type="text" value="" />
<button type=submit>Search</button>
</form>
Does anyone know why? This seems pretty simple and straighforward to me.