Hi Everyone,
I have a multi-tiered question which I hope someone can help with.
Here’s a scenario I’m trying to code for....
I have a “Customer Lookup” screen where I have 2 Text Boxes (First Name and Last Name). Below this I have numerous labels which I use to display other information about the customer once one has been found in the database (such as contact numbers, address, company name etc).
What I’m trying to achieve is to use the Ajax AutoComplete extender to return results when the user starts typing in either the txtFirstName or txtLastName. I want the results to take the values inboth fields into consideration.
For example,
If I start typing “Ric” into txtFirstName, I may start seeing a list of names like
Richard Fielder
Richard Sampson
Ricky Jones
Riccardo Samuels
But if I then tab to the txtLastName field and start typing “Sam”, the list should then only show
Richard Sampson
Riccardo Samuels
I have used the AutoComplete extender before. I’m not concerned at this point about how I would write the code for the webservice to return values from the database (I’m comfortable extracting data from the database etc). I’m also already aware that you can only specify one Target ID for the AutoComplete extender and therefore any solution here may be difficult, if not impossible.
As a follow up to the above, assuming the above can be accomplished, what I’d really like to happen is that if the user clicks on a customer name in the list returned by the extender (i.e. they’ve spotted the one they’re looking for), then I want to automatically lookup the customer details from the database and populate the rest of the screen.
Now, to do this, I understand I’d need to return the key field (which is a guid)...but I don’t want this displayed in the list, of course. I’m not aware of any way the AutoComplete can return Hidden data for each item returned etc.
It may well be that I’m trying to use AutoComplete extender for functionality it simply wasn’t intended for and therefore I should be looking at some other alternative. What I liked about this extender was how it activated as I typed rather than when the text fields lost focus.
If anyone could offer any advice on whether I can achieve this using the AutoComplete extender or not would be great.
If I can’t, are there other ajax controls or other (reasonably straight forward) methods to achieve similar functionality?
Thanks in advance for any assistance,
Mary