Solved

Passing parameters between asp pages in Frontpage

Posted on 2004-04-05
10
207 Views
Last Modified: 2013-12-24
Hi,

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.
Matt
0
Comment
Question by:sluthfool
  • 4
  • 4
10 Comments
 
LVL 12

Expert Comment

by:rcmb
ID: 10765217
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

<%=varResort%>

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).
RCMB


Note: You have an error on the ResortAdvancedSearch.asp page on line 48.
0
 

Author Comment

by:sluthfool
ID: 10766844
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.

Matt
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10767281
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>
 </select>

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.

RCMB
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10769592
sluthfool,

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.

RCMB
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:sluthfool
ID: 10769894
I'm working on it now... give me a few minutes and I'll let you know what's going on.

Thanks.
Matt
0
 

Author Comment

by:sluthfool
ID: 10770164
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?

Matt
0
 

Author Comment

by:sluthfool
ID: 10770189
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?  

Matt
0
 
LVL 12

Accepted Solution

by:
rcmb earned 75 total points
ID: 10770871
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.

RCMB
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now