[RESOLVED]autocomplete search for dropdown in mvc4

Hi,

i am working on mvc4 razor.

I have a dropdown where i am showing all locations.Now i want to implement auto complete search on same dropdown.

My requirement for search is given below:

1) This dropdown should be editable as i can type any text in this dropdown.

2) this dropdown contains locations but i want to perform search on Zip code.

for eq. if i enter zip code 27892 then all locations of that zip code should be display in my dropdown.

Please help to solve this requirement.

Thanks in advance!

Regards

Rajni

you will have to return array of locations comparing zipcode

 string query = string.Format("SELECT DISTINCT location FROM 
                Customers WHERE zipcode LIKE '%{0}%'", keyword);

check below url for detail implementation

http://dotnetmentors.com/aspnet/jquery-autocomplete-by-example.aspx

Leave a Reply