I have a simple search form on my _Layout page.
How can I easily pass the value from search-fld to the controller? Without having to create a Model or ViewModel.
@using (Html.BeginForm("Search", "Home", new { id = "search-fld" }, FormMethod.Post, new { @class = "header-search pull-right" }))
{
@Html.AntiForgeryToken()
<input type="text" placeholder="Search" id="search-fld">
<button type="submit">
<i class="fa fa-search"></i>
</button>
}
If I run this then "search-fld" get send to the controller (offcourse)
Use Ajax form instead and get the value with Jquery?