tags:

views:

57

answers:

3

I have state and city dropdown list in asp.net 3.5 applicattion .

but i want city as a textbox when i type keyword then autocomplete mode should be occour .

I want to implement it through juery could u please send code for this.

Thanks Manoj

+4  A: 

http://docs.jquery.com/UI/Autocomplete

Menno
A: 

$("#yourtextboxID").autocomplete({source: ["Los Angeles","Las Vegas","Madrid"]});

Alexander
Thanks Alexander But tell me one thing how to bind source .This source in C# file which contain id and values of cities .
Manoj Wadhwani
$("#yourtextboxID").autocomplete({source: [{value:1, label: "Los Angeles"},{value:2, label: "Las Vegas"},{value:3, label: "Madrid"}],select: function(event, ui) {$('#yourtextboxID').val(ui.item.label);$('#yourhiddenfieldID').val(ui.item.value);return false;}});
Alexander
Thanks for you help.But i want to give source from c# function to in source there sould be function how can i call function in source :
Manoj Wadhwani
A: 

The most straightforward way is to use the jQuery Autocompleye plugin.

If that doesn't tickle your fancy, try checking out this question. If you're having problems specifically with Asp.NET in conjunction with jQuery and AJAX, it looks like this question may be of use as well.

LeguRi