• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Passing parameters between asp pages in Frontpage


I am working on an advanced search using FrontPage, dropdown boxes, and the Database Results Wizard.

If you go to http://www.resortequitymarketing.com/Listings/ResortSearch.asp you can see exactly what I"m dealing with.

On the first page (called ResortSearch.asp) I have a dropdown box from which the user selects a 'ResortName'.  They are then taken to a page (called ResortResults.asp) displaying the database results region that contains all the matching results.  

If the user clicks an "advanced search" hyperlink they are then taken to a page (called ResortAdvancedSearch.asp) where they (hypothetically) narrow their search down by selecting from dropdown boxes for 3 fields:  Bedrooms, Bathrooms, and PriceRange.  I want the resort name to be 'remembered' from the previous page.  After clicking 'submit' they will then taken to a page (called AdvancedResortResults.asp) that shows the records that match all 4 fields (ResortName, Bedrooms, Bathrooms, and PriceRange).

The "advanced search" link appears below the table with each result.  (I don't know how to do a link with parameters if it is NOT in the database results region.) To 'remember' the ResortName I currently have the "Advanced Search" hyperlink parameters set to this:

Name:  ResortName
Value:  <%=FP_FieldHTML(fp_rs,"ResortName")%>

ResortAdvancedSearch.asp currently has its Advanced Form Properties set equal to the same thing (making ResortName a hidden field, I believe.  It doesn't necessarily need to be hidden though.)

Right now it's not working.  What do I need to do to fix it?  

In summary, I want the ResortName to be passed to the ResortAdvancedSearch.asp and then to AdvancedResortResults.asp along with Bathrooms, Bedrooms, and PriceRange.

Thank you very much for any assistance.
  • 4
  • 4
1 Solution
You are already capturing the value (resortname) in a querystring so this makes it very easy.

At the top of the ResortAdvancedSearch.asp (after <html>) enter the following:

<% varResort = request.querystring("ResortName") %>

Now in your form add a drop-down box called ResortName and in the value enter


This will take care of the problem with passing the data to the ResortAdvancedSearch.asp page but I need more information on the AdvancedResortResults.asp page (this page generates an error).

Note: You have an error on the ResortAdvancedSearch.asp page on line 48.
sluthfoolAuthor Commented:
Okay, so that did help.  I am now successfully passing "ResortName" from ResortResults.asp to ResortAdvancedSearch.asp.  (You can see what it does now by following the original link.)

However, I am not able to successfully pass the 4 fields (ResortName, Bedrooms, Bathrooms, and PriceRange) to AdvancedResortResults.asp.

Here's all the information:  For each of the four dropdown boxes on ResortAdvancedSearch.asp I have the 'submit value' (from the DRW) set to the corresponding field.  (I.e. Bedroom submit value is Bedroom.)  The Any Option choice comes from the Drop Down box properties with a specified value of "%" (without the quotes).  That *should* function as an 'allow any value in this dropdown box'.

In AdvancedResortResults.asp the SQL (from the code) is set to:

SELECT * FROM qryForWeb WHERE (ResortName =  ::ResortName:: AND Bathrooms =  ::Bathrooms:: AND Bedrooms =  ::Bedrooms:: AND PriceRange =  ::PriceRange::) ORDER BY DateEntered DESC

If you would like to look at the page a good 'ResortName' to pick is "Westgate Lakes Resort" as it has hundreds (thousands?) of matches.

If I'm leaving anything out that you need to know please tell me.  I'll reply quickly.  Thank you very, very much for the assistance.

Try changing the SQL query to read:

SELECT * FROM qryForWeb WHERE (ResortName =  '::ResortName::' AND Bathrooms =  '::Bathrooms::' AND Bedrooms =  '::Bedrooms::' AND PriceRange =  '::PriceRange::') ORDER BY DateEntered DESC

Leaving the single quotes out tells the query to look for numbers vice text.  

If you want to pass wildcards I recommend adding a choice to each drop down (bathroom, bedrooms, pricerange) for Any Option like you have and then check the specify value option and leave the default there. Switch to html mode and remove Any Option from between the quotes (after option value=) so it looks like:

<select size="1" name="Bedroom">
 <option value="">Any Option</option>
 <option>1 BR</option>
 <option>2 BR</option>

Then I would modify the query to look like:

SELECT * FROM qryForWeb WHERE (ResortName =  '::ResortName::' AND Bathrooms LIKE '::Bathrooms::%' AND Bedrooms LIKE '::Bedrooms::%' AND PriceRange LIKE '::PriceRange::%') ORDER BY DateEntered DESC

This will return the results you desire.

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Not sure what you are trying on the ResortAdvanceSearch page but it looks like you need to perform a group by query to limit the values returned. It looks like you are letting FP build a drop down for you by drawing from your database.

If this is the case try editing your SQL code in HTML view (the gray code) and modifying your sql to look like:

SELECT ResortName FROM qryForWeb WHERE (ResortName =  '::ResortName::') GROUP BY ResortName ORDER BY ResortName ASC

Just a recommendation on what I saw.

sluthfoolAuthor Commented:
I'm working on it now... give me a few minutes and I'll let you know what's going on.

sluthfoolAuthor Commented:
I changed the ResortAdvancedSearch.asp code for ResortName to match yours (SELECT ResortName FROM qryForWeb WHERE (ResortName =  '::ResortName::') GROUP BY ResortName ORDER BY ResortName ASC
).  However, now the dropdown box isn't showing ANY values.  I'm not sure why that is.  Previously, the ResortName dropdown box was displaying all ResortName values in a dropdown box with the ResortName from the previous linked page automatically selected.  

As for the other dropdown boxes (Bedrooms, Bathrooms, PriceRange) they are supposed to show all values that are contained in qryForWeb where ResortName = ResortName.  This seems to be working.  (If there is a blank value in the dropdown box (as there is when using Westgate Lakes Resort) for Bedrooms, Bathrooms, or PriceRange it is because there is a record in the database matching the ResortName where that value was left blank.)

I changed the AdvancedResortResults.asp code to this as you recommended:
SELECT * FROM qryForWeb WHERE (ResortName =  '::ResortName::' AND Bathrooms LIKE '::Bathrooms::%' AND Bedrooms LIKE '::Bedrooms::%' AND PriceRange LIKE '::PriceRange::%') ORDER BY DateEntered DESC

I do really appreciate your help.  Any suggestions on what to do next?

sluthfoolAuthor Commented:
Oh, and I don't quite understand the SQL code for AdvancedResortResults.asp that I changed it to.  

Bathrooms LIKE '::Bathrooms::%'

What exactly does that do/mean?  

For some reason the querystring is not being passed to the page.

Try this query and see how it works:

SELECT ResortName FROM qryForWeb GROUP BY ResortName ORDER BY ResortName ASC

This will make sure we are drawing all of the information.

If this works then try:

SELECT ResortName FROM qryForWeb WHERE (ResortName =  '::ResortName::') ORDER BY ResortName ASC

A quick way to test if the querystring is being passed is to enter the following at the top of the page and see if it displays

<% var1 = request.querystring("ResortName") %>
<% = var1 %>

If you see the Resort Name passed from the previous page then you have what you need and we can proceed from there.

As for Bathrooms LIKE '::Bathrooms::%' what is does is put a wild card at the end of the value you pass.

For instance if you passed 2 it may return 2 BR, 2 XX, 2 whatever

It means begins with whatever you pass and you do not care what it ends with.

You need to modify the drop down boxes from this:
<option selected value="%">Any Option</option>

to this:
<option selected value="">Any Option</option>

The sql query has the % in it and with the blank in Any Option you get all regardless because everything begins with nothing - if you get what I mean.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now