search bar in mvc
Index.cshtml CODE <input type="text" id="prodId" size="7" /> <button class="btn btn-info my-2 my-sm-0" caption="search" id="search-now"> Search</button> <div id="search-results"> </div> put that on your page want your search bar to display. the div id search results are where you want your search results to display. In your views folder, create a Search Folder . add item Razor View named _SearchRestults.cshtml (this is a partial) CODE @model LegoListViewModel <div class="row"> @foreach (var lego in Model.Legos) { <div class="col-md-4"> <figure><a href=" @lego.URL " target="_blank"><img src=" @lego.Images " /> ...