I'm using Html.BeginForm and trying to pass the supplied value of the textBox "archName" to the post, How can I do that? I mean what should I add instead of "someString"?
<% using (Html.BeginForm("addArchive", "Explorer", new { name = "someString" }, FormMethod.Post)) { %>
<%= Html.TextBox("archName")%>
The name that you are referring to is the name attribute of the form HTML element, not posted values. On you controller you can access a few ways.
With no parameter in controller method:
With the
FormCollectionas parameter in controller method:With some model binding: