 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 23rd, 2003, 01:49 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
what's image?
|
|

September 23rd, 2003, 02:38 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Image is "waking up too early and making a post while still sleepy" for Imagine ;)
It should have read:
' Imagine Listbox users, called lstUsers
If Request.Form("lstUsers") <> "" Then
SQL = SQL & " AND Users = '" & Request.Form("lstUsers") & "'"
End If
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

September 24th, 2003, 12:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, you need to save the state of the selected list boxes.
But like I explained in my previous post, you can retrieve the state from the currently selected it. Here's the basic flow again for just one single drop-down:
1. You create a drop-down which is sent to the browser
2. The user selects an item and sends the page to the server
3. You retrieve the selected item using Request.Form("lstList")
4. When you recreate the drop-down, you use the previously chosen item to preselect that item in the drop-down
5. The user submits the form again
6. You retrieve the selected item
7. When you recreate the drop-down, you use the previously chosen item to preselect that item in the drop-down
And so on and on. As you can see, you can always retrieve the selected item from the drop-down, thereby saving its state.
If you press a "Clear" button, all you need to do is *not* preselect the item in step 4 and 7.
I suggest a couple if things to get this page to work ASAP:
1. Start a new page that just uses a single drop-down. No sort order stuff, etc, just a simple query, and a simple drop-down.
2. Once that works, and you see how it all fits together, add additional drop down.
3. The add your sorting stuff
4. Then add your paging stuff
5. Then expand your query so it retrieves what you need.
I think that when you follow these steps, at step 5 you should be able to understand what happens in your current page exactly, and you should be able to fix it.
Smaller pages also make it much simpler to post code on this forum. The pages you have posted so far are just to big to look through and understand completely without being able to run it (don't forget, I don't have your database and other pages here; all I can do is look at this post and see the code).
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

September 24th, 2003, 05:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Well, IMO, it's an either / or situation.
Your user either selects a new filter criterion from one of your drop-downs or your user selects one of your navigation links.
When they select a new item from the drop-down, the page should reload automatically (using an onchange attribute on the <select> tag). When that happens, the navigation starts again at page 1 because the criteria have changed.
When they click one of the navigation links, the values for the drop-downs should already have been preserved in the QueryString. As long as they click the nav links, the drop-downs should remain at their selected values, as those should be retrieved from the QueryString, and not from the drop-down itself.
Does this make sense?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

October 1st, 2003, 08:54 PM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi imar, i got it. ;p thanks for ur help :)
i used session and a if- else to either pass either the string(href) or the form to a variable.
i also changed the if statement of the listbox, checking if the string isnull instead of just form isnumeric.
:D
|
|

October 2nd, 2003, 01:38 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Glad it finally worked. I think you have proven that maintaining someone else's code is more difficult than creating your own ;)
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |