Reputation: 2631
I am implementing the Autocomplete textbox from AjaxControlToolkit in ASP.NET. The ServiceMethod allows me to call a function which will populate a string list with which to populate the autocomplete list that will display.
My question is, when I call the database, I would like to store an ID that corresponds with each selection, so that once it is selected by the user, I can easily look it back up in the database. I don't want to display it in parentheses next to the selection (ie. "John Smith (ID1234)", etc.)
Is there a way to do this so that the ID is 'hidden' so to speak within the Autocomplete box, and can be retrieved on selection? Should i use a different autocomplete box to accomplish this? Any help is greatly appreciated. Thanks!
Upvotes: 1
Views: 2845
Reputation: 223282
This might answer your question http://www.aspsnippets.com/Articles/Fetch-multiple-values-as-Key-Value-pair-in-ASP.Net-AJAX-AutoCompleteExtender.aspx
Upvotes: 2