Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional linking.... HowTo?

Status
Not open for further replies.

Timsi

Technical User
Nov 5, 2001
2
NL
In Frontpage2000 I made a table using the DatabaseResultWizard. when clicking a record from the table the 'detail-information' from the corresponding record is displayed. This works fine!
My next step is displaying a page conditional to the requested record.
Example: when selecting record2 (record 2 is type A) from the table I want page A to be shown. When selecting record 54 (for example, is type B) I want page B to be shown.
(all pages are .asp)

Suggesions anybody?
 
So what you're saying is that you want a link on the detail information page that will direct to user to a page dependant on the type of record being displayed.

If so, do any of the fields for that record describe the type (you mentioned Type A) and what is stored in that field. (ie.. just the letter A, the word "Type A", ??)

ToddWW
 
Thnx for the reaction!
Correct; depending in the information in a field of the recordset, I want to view the recordset-details.

Here is the situation: the user sees the result-table and can select a record. Depending on the dbfield 'purpose' (txt) it has to display either asp-page A or asp-page B.

(it is used to view information about renting and buying appartments; there are different properties for 'rent' and different properties for 'buy')
 
For FrontPage 2000, you'll have to use Step 2 of the Database Wizard. Choose the Custom Query radio button and then click the "Edit" button. You'll have to enter the SQL string manually to generate a detail page. FP doesn't have a customized function or component that'll do this for you, so you may have to edit some of the VBScript code directly.

Saying, for sake of argument, you're using an Access DB with a table structure as follows:

TABLENAME:
People

FIELDS (DataType):
PeopleID (AutoNumber)
FirstName (Text)
LastName (Text)
Age (Number)
Phone (Number)
Email (Text)

...you can use this as your SQL string:
SELECT * FROM People WHERE PeopleID='" & PeopleID & "'"

This would load a customized page based on the data for that specific record.

To generate a page based on a conditional choice by the user, this is tricky in FP, but you could do something like this in your VBSctipt scriptblock:

<%
If CInt(PeopleID) > 54 Then
Response.Redirect(page2.asp)
Else
Response.Redirect(page1.asp)
End If
%>



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top