Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Populating List

Reply
Thread Tools

Populating List

 
 
=?Utf-8?B?V2FyYW4=?=
Guest
Posts: n/a
 
      04-06-2006
a combo box that starts off empty. The user can type int he combo box, and as
he types, after the third letter has been typed, the page does a lookup
against a database (SQL String) to our server, and populates the combo with
matches, and the combo box drops down so they can see them. There would be
two fields in the combo box, Firm Name and City. They could either pick from
the list or keep typing to narrow the search down. With each successive
keystroke (after three) we would execute the search again and re-populate the
listbox. For example, the user could type in "State" and would get a list of
maybe 30 matches for that text in a list or combo box above that name field
on the order form. They could then select from that list. If there were no
matches they could delete what they've typed and try again, or give up and
simply type out the whole name and address on the order form without using
the list.

I am using VS.NET 2003.

Please let me know how to achieve this
 
Reply With Quote
 
 
 
 
sirfunusa
Guest
Posts: n/a
 
      04-06-2006
I doubt you'll want to hit the database after they type some letters.
The pause and repopulate would be very annoying, I would think...the
page would refresh each time. Unless you use some advanced technique
like AJAX. So, bring everything (if you can) clientside to start with,
then use client scripting to achieve the same result.

 
Reply With Quote
 
 
 
 
Chris Fulstow
Guest
Posts: n/a
 
      04-06-2006
Sounds like you want something similar to Google Suggest:
http://www.google.com/webhp?complete=1&hl=en

This uses AJAX techniques to keep refreshing the list without having to
reload the page. A blogger Chris Justus has disected the code behind
this and has also deciphered the JavaScript. Hopefully it might
provide some useful hints:
http://serversideguy.blogspot.com/20...dissected.html

You might also want to look at caching your data, maybe in a DataSet in
the Cache object, so it doesn't bombard your database with requests at
every keystroke.

Cheers,
Chris

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
binding to current value in a drop down list when populating from a database TB ASP .Net 5 11-02-2005 08:59 PM
best method for populating drop down list control? msnews.microsoft.com ASP .Net 1 08-07-2004 07:25 PM
populating a Drop down list Casey ASP .Net 6 07-05-2004 10:39 PM
populating a dropdown list from arraylist of objects Paul M ASP .Net 1 05-26-2004 11:46 AM
populating an asp list box from a simple access lookup list (single column not a table) gerry ASP .Net 0 04-24-2004 09:21 AM



Advertisments