0

I have an Ajaxtool kit AutoComplete extender control that targets to a Text box. I am calling a web service and returning the values to bind to the AutoComplete extender and that works great. I am really wondering about how I can retrieve the AutoCompleteextender control's Item values in javascript, when an Item is selected.

When an item is selected I am capturing the selected value in javascript function by calling the function in OnClientItemSelected attribute.

<pre>function CallJS(source, eventArgs) {
    alert('something got selected');
    alert(eventArgs.get_value());
}

But I am not sure using which Javascript property or object I can get hold of the list of values in the AutoComplete extender control?

SARAVAN
  • 14,571
  • 16
  • 49
  • 70

1 Answers1

1

Use hidden field. U can store value in javascript and get it also in server side.

function ItemSelected(sender, EventArgs)
            {
                hid.value = EventArgs.get_value();
            }
Nikhil D
  • 2,479
  • 3
  • 21
  • 41
  • Ok. This will get selected value from the list. But what if I wanted to get the list of items bound to that autocomplete extender at that time? That was my question. – SARAVAN Jul 16 '12 at 13:44
  • r u using webservice or what for autocomplete – Nikhil D Jul 16 '12 at 13:45
  • Yes I use a web service and it returns the list of values which is good. Now at any point when an item is selected from the control I wanted to fire a javascript which should be able to get hold of the list of items bound to the AutoCompleteExtender. – SARAVAN Jul 16 '12 at 13:50
  • Can be flagged for deletion. Opened another question at http://stackoverflow.com/questions/11515188/ajax-tool-kit-autocomplete-dropdown-usage-with-asp-net – SARAVAN Jul 17 '12 at 02:18