Populating List

Discussion in 'ASP .Net' started by =?Utf-8?B?V2FyYW4=?=, Apr 6, 2006.

  1. 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
    =?Utf-8?B?V2FyYW4=?=, Apr 6, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?V2FyYW4=?=

    sirfunusa Guest

    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.
    sirfunusa, Apr 6, 2006
    #2
    1. Advertising

  3. 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/2004/12/google-suggest-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
    Chris Fulstow, Apr 6, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gerry
    Replies:
    0
    Views:
    535
    gerry
    Apr 24, 2004
  2. Paul M
    Replies:
    1
    Views:
    754
    Rick Spiewak
    May 26, 2004
  3. Casey

    populating a Drop down list

    Casey, Jul 5, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    526
    casey
    Jul 5, 2004
  4. msnews.microsoft.com

    best method for populating drop down list control?

    msnews.microsoft.com, Aug 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    539
    Fred Newton
    Aug 7, 2004
  5. TB
    Replies:
    5
    Views:
    2,847
Loading...

Share This Page