Posts

Showing posts with the label Bootstrap Typeahead.js

Donate

Using Bootstrap Typeahead.js Plugin In ASP.NET MVC Project

Image
Hello all, Bootstrap has lots of plugins that you can experiment with, and one of them is the Typeahead.js plugin similar to jQueryUI Autocomplete plugin. According to Bootstrap, Typeahead is an extendend plugin for quickly creating elegant typeaheads with any from text input. So given the description of the widget, I will provide a tutorial that integrates the plugin in an ASP.NET MVC project basing from this article Twitter Bootstrap Typeahead and ASP.NET MVC . The author from the source demonstrates preloaded country values but in my case, I modified it to handle searching through a database. So to proceed with, just follow the steps below: 1. Create an ASP.NET MVC Project (C#). 2. Add an ADO.NET Entity model that connects to the AdventureWorks DB and it's CountryRegions table. 3. In your home controller, add the code that search countries based on a given value. private static AdventureWorks2012Entities _context; // // GET: /Home/ public ActionResult Index() { ret

Donate