Hi i have no idea with creating event textchanged or somethink as this for textBox. It will be doing some form of find when text changed.
@{
ViewBag.Title = "Index";
<br />
using (Html.BeginForm())
{
<p>
<p>
@Html.TextBox("searchString")
<input type="submit" value="Find" />
</p>
</p>
}
}
<h2>Index</h2>
I want it call this (This is written right):
public ActionResult Index(string searchString)
{
if (String.IsNullOrWhiteSpace(searchString))
{
return View(db.Regions.ToList());
}
else
{
List<Regions> collectionOfRegions = db.Regions.ToList();
return View(collectionOfRegions.Where(x => x.MatchBetweenAllFields(searchString)));
}
}