I came across the following situation in one of the views
I have a search field:
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
@Html.TextBox("parametroProcura")
</div>
<button type="submit" class="btn btn-default">Pesquisar</button>
</form>
Reading, and seeing some videos on the internet, I noticed that the staff places the search field within a @Html.BeginForm
:
@using (Html.BeginForm())
{
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
@Html.TextBox("parametroProcura")
</div>
<button type="submit" class="btn btn-default">Pesquisar</button>
</form>
}
However, the search works in both cases, so ... why use @Html.BeginForm
?