Hi I have a question how can I improve my code that I can search through my database by putting at least one letter in textbox not all the title. Now it's searching but I need to put whole title to search something.
My search bar:
@using (Html.BeginForm("SearchVideo", "Video", FormMethod.Post, new { @class = "navbar-form navbar-left", @role = "search" }))
{
<div class="form-group">
@Html.TextBox("searchVideo", (object)null, new { @class = "form-control", @placeholder = "Wyszukaj film" })
</div>
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
}
My VideoListViewModel:
public class VideoListViewModel
{
public IEnumerable<Video> VideoList { get; set; }
}
My searching View:
<div class="list-group">
@foreach (var video in Model.VideoList)
{
<a href="/Video/GetVideo?id=@video.Id" class="list-group-item clearfix">
<img src="~/Images/@video.ImageUrl" style="width: 80px; height: 100px; padding: 5px;" />
Premiere: @video.Date
<br/>
</a>
<br/>
}
</div>