473,563 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dropdown in ASP Page

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
Jul 19 '05 #1
4 1714
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/ind...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"
Jul 19 '05 #2
On Fri, 13 Aug 2004 09:52:49 +0100, "JP SIngh" <no**@none.co m> 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.QuerySt ring(Product) & ">"

Jeff
Jul 19 '05 #3
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.yourFunc tion(textVariab le,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
Jul 19 '05 #4
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.queryst ring("page") = "" Then

pageno = 1

Else

pageno = request.queryst ring("page")

End If

'Number of pages 50

rs.pagesize = 50

totalpages = CInt(rs.pagecou nt)

'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" <no**@none.co m> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
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

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8266
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two dropdown lists. If you change the selection of the left one (e.g. choose parentoption2), it should open up page2.htm in a popup window.
0
1781
by: Henke | last post by:
Hi, I have done some research about my problem I have when using the "back button" in IE to go back to a page with two dropdown lists. The both dropdown lists are populated with data. The first dropdown lists is redirecting the user to another page (building a querystring for the second page to use) and when the back button
8
278
by: Kris Rockwell | last post by:
Hello, I have done the following to bind data to a DropDown box: 1. Drag SQLServer table onto web form to create data connection and data adapter. 2. Generate dataset by right-clicking on the data adapter ad selecting generate dataset.
6
10668
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. Let's say you select 1 of the items, and are properly redirected. You press the back button. I have three servers providing two different...
2
4536
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am...
3
4418
by: devNorway | last post by:
I have been struggling with a problem for days now, and searched for related problems and solutions but had no luck. I have two dropdown listboxes where the first is populated in page load and the second is populated based on the input in the first. The first dropdown is inside a "If Not Page.IsPostBackThey" if loop. Both have autopostback...
1
4082
by: Oleg | last post by:
Hi, I'm having a problem with page caching and therefore reusing dropdown box contents. Scenerio: user1 has security to see list of three items(.aspx populates it with three items only) in dropdown on page1. user2 has security to see list of two items in dropdown on page1. user1 logs in. when user1 gets to page1, dropdown has three items.
2
2841
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box appears in the cell, but allways the first item in the dropdown box is shown not the current cell value? How do I make the current value in the cell ...
11
4611
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1. category which comes from database 2. brand which comes from databse according to content of first dropdown . and 3. price which is static. when i...
5
10328
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 I would like to add a checkbox or dropdown control to the .RLDC and have Item #1, Item #2, or Item #3 display conditionally based on a checkbox being...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.