Responsive phone-book - howto - a design issue, not a coding one.

R

Radu

Hi. I need to implement a "phone-book" kind of feature - I have a list
of about 50.000 people, and the user should be able to find anyone by
typing either the (beginning of the) last name, either the (beginning
of the) first name.

Assume that the list of names is:

abc
abcd
abd
ac
adu
adv
aeg
bai
bah

I need incremental search, so by typing "ad" i get to chose from "adu"
and "adv", but if I type "adv" i see the details for Mr. ADV. Of
course, if I backspace to just "a" I should have to select from all 7
records which start with "a".

The app needs to be responsive (i.e. if possible a minimum of server
round-trips). How could I implement this ? OnTextChanged of a textbox
involves a post. Is it possible to do without a post ? Anyway, I have
no KeyDown/KeyPressed/KeyUp events here, as I would have in
traditional programming, so each key press should then be followed by
a post ? This would be at least very annoying ! Would JavaScript help
me in this instance ?

Also.... could loading the 50K records in a collection/list on
page_load help with the response time ? Is this not to expensive/slow
on load ?

Please advise on how to attack this problem !

Thank you very much
Alex.
 
B

bruce barker

the normal solution is an ajax (javascript) based. in javascript you can
catch the keydown/keyup. then on each keypress you call back to the server to
get the list.

for this to work the server paging code needs to be real fast (100ms or
less). the page response should be small (<10k).

this is often called autocomplete. the ajax toolkit has one, but you still
need to make the server code fast.

-- bruce (sqlwork.com)
 
Y

younlaot

Yup! For a super quick was to implement this (if you don't want to
code alot of new technology you might not know too much about) go to
google and search for ASP.NET AJAX. You will find a control toolkit
that comes with an autocomplete control you can slap down and it has a
tutorial on connecting to the DB to get the results after each
keystroke. Great way to do exactly what you want, you will love it!
 
I

Ian Semmel

You should investigate using a soundex field as an index which allows
the user to type in what he/she thinks the way the name is spelt eg
Smith Smyth etc will both match
 
R

Radu

Thank you all for your suggestions. I am currently looking at AJAX's
AutoCompleteExtender.

Again, thanks a lot for your spending time answering me.

Alex.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top