Dropdown in ASP Page

Discussion in 'ASP General' started by JP SIngh, Aug 13, 2004.

  1. JP SIngh

    JP SIngh Guest

    I have three dropdowns in one of my asp page. Each dropdown does return a
    huge amount of records , 5000 to be precise.

    The huge amount of data makes the page slower to load and also makes it
    extermly diffcult for users to choose one value from the list.

    Does someone have a better solution to implement this?

    I guess one of the things that I am keen on is to have a textbox (readonly)
    and a pop up window to allow users to search for a particular product and
    then clicking the found product closes the pop up windwo and adds the
    selected product value to the textbox.

    Does anyone know how to transfer the value of the selected product to the
    textbox on the main form.

    Regards
     
    JP SIngh, Aug 13, 2004
    #1
    1. Advertising

  2. JP SIngh wrote:
    > I have three dropdowns in one of my asp page. Each dropdown does
    > return a huge amount of records , 5000 to be precise.
    >
    > The huge amount of data makes the page slower to load and also makes
    > it extermly diffcult for users to choose one value from the list.
    >
    > Does someone have a better solution to implement this?
    >


    Use a dynamic listbox instead of a dropdown. Download my demo from
    http://www.thrasherwebdesign.com/index.asp?pi=links&hp=links.asp&c=&a=clear
    to see one way of doing it.

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Aug 13, 2004
    #2
    1. Advertising

  3. JP SIngh

    Jeff Cochran Guest

    On Fri, 13 Aug 2004 09:52:49 +0100, "JP SIngh" <> wrote:

    >I have three dropdowns in one of my asp page. Each dropdown does return a
    >huge amount of records , 5000 to be precise.
    >
    >The huge amount of data makes the page slower to load and also makes it
    >extermly diffcult for users to choose one value from the list.
    >
    >Does someone have a better solution to implement this?


    Of course. Write your code so it doesn't return 5,000 records.
    Nobody's going to look at that many anyway.

    >I guess one of the things that I am keen on is to have a textbox (readonly)


    Why would it be read only?

    >and a pop up window to allow users to search for a particular product and
    >then clicking the found product closes the pop up windwo and adds the
    >selected product value to the textbox.


    So do it. We aren't stopping you. :)

    >Does anyone know how to transfer the value of the selected product to the
    >textbox on the main form.


    How's this?

    Response.Write "<input type="text" name="product" value=" &_
    Request.QueryString(Product) & ">"

    Jeff
     
    Jeff Cochran, Aug 13, 2004
    #3
  4. JP SIngh

    Tarwn Guest

    If you still want to implement a pop-up search you would be belooking at some
    client-side scripting in your future.

    basically you will want to open the little search window (probably using
    somehting like window.open() ) and allow the user to search, so minimujm one
    small searcyh form page and one search results page.

    At this point you have two options, either pass back the list of search
    results to fill the dropdown or pass back only a single results. My advice
    would be to pass back just a single result. My assumption is that in addition
    to what your displaying to the user you may have some sort of id in the
    backgroundthat your code prefers to deal with. In this case you would need to
    pass back both the display text andthe key/id to the original page.

    The eaisest way to handle this would be to build a small javascript function
    in the original page tat accepts two values and then assignes them to a text
    input/hidden input pair. The child window (popup) would call the function
    based on it's parent object reference, so it would be something like:
    parent.yourFunction(textVariable,idVariable);

    So basically you would want to create your links in your search results with
    an onClick function to call that parent function then call the window.close
    method to get rid of the little popup window.

    If you need additional search forms based on values chosen from earlier
    searches (ie, search #2 is limited by the results tey chose from search #1)
    thn you would just pass those limiting values in the querystring of your
    window.open call to open the second search popup.

    -T
     
    Tarwn, Aug 13, 2004
    #4
  5. JP SIngh

    Carroll Guest

    Use the following method:

    Previous Next
    1 2 3 4 5 6 7 8 9 10

    and only put 20 to 50 per page. (do this in asp and it will automatically
    create your pages for you)

    Example:

    If request.querystring("page") = "" Then

    pageno = 1

    Else

    pageno = request.querystring("page")

    End If

    'Number of pages 50

    rs.pagesize = 50

    totalpages = CInt(rs.pagecount)

    'which page to work with

    rs.absolutepage = pageno

    If totalpages > 1 Then

    'forward/next buttons

    response.write"<tr><td>"

    'see wether to write a previous

    If pageno > 1 Then

    response.write "<A href=flyer.asp?page=" & pageno - 1 &
    ">Previous</a>&nbsp;"

    End If

    'see if we're not at the last page!

    If int(pageno) < int(totalpages) Then

    response.write "<A href=flyer.asp?page=" & pageno + 1 & ">Next</a>&nbsp;"

    End If

    response.write("<BR>")

    'do the page numbers

    For A = 1 To totalpages

    'check to see if it is the current page - write in red if it is

    If Int(A) = Int(pageno) Then

    Response.write "<font color=red>" & A & "</font>&nbsp;"

    Else

    Response.write "<A href=flyer.asp?page=" & A & ">" & A & "</font></a>&nbsp;"

    End If

    Next

    response.write"</tr></td>"

    End If

    x=0

    'now display the records

    For x = 1 To 50

    If rs.EOF Then

    'we're at the end of the recordset so exit..

    Exit For


    --


    Regards,

    Carroll


    "JP SIngh" <> wrote in message
    news:...
    > I have three dropdowns in one of my asp page. Each dropdown does return a
    > huge amount of records , 5000 to be precise.
    >
    > The huge amount of data makes the page slower to load and also makes it
    > extermly diffcult for users to choose one value from the list.
    >
    > Does someone have a better solution to implement this?
    >
    > I guess one of the things that I am keen on is to have a textbox

    (readonly)
    > and a pop up window to allow users to search for a particular product and
    > then clicking the found product closes the pop up windwo and adds the
    > selected product value to the textbox.
    >
    > Does anyone know how to transfer the value of the selected product to the
    > textbox on the main form.
    >
    > Regards
    >
    >
     
    Carroll, Aug 14, 2004
    #5
    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. vishnu
    Replies:
    1
    Views:
    1,241
    Patrick.O.Ige
    Mar 25, 2006
  2. Mike
    Replies:
    1
    Views:
    844
  3. acadam
    Replies:
    0
    Views:
    777
    acadam
    Dec 27, 2006
  4. Replies:
    2
    Views:
    458
  5. Steve Myers
    Replies:
    2
    Views:
    290
    Steve Myers
    Nov 20, 2003
Loading...

Share This Page