Skip to main content

Linking Two Pages

Now that we know how the FilmID gets to the ShowTimes page (via the URL and then the Request object) and how it gets used in our query, let's return to the TopPicks page and add the button that the user clicks on to display ShowTimes.

First, we add an image tag that shows our button, generated description: showtimessample.gif.

<img src="ShowTimes.gif" width="130" height="39" border="0">

This image (img) tag is placed within the TopPicks.csp page as follows:

—TopPicks.csp—
TopPicks.csp
<html> <body>
<h2><font color="#0000FF">Today's Top Picks</font></h2>
<table border=0>
<csp:query name=FilmList classname="Cinema.Film" queryname="TopFilms">
<csp:while condition="FilmList.Next()">
    <tr>
    <td>
    <b>#(FilmList.Get("Title"))#</b><br>
    #(FilmList.Get("Description"))#<br>
    <b>Genre</b> #(FilmList.Get("CategoryName"))#
    <b>Length</b> #(FilmList.Get("Length"))#
    <b>Rating</b> #(FilmList.Get("Rating"))#<br>
    <br>
    </td>
    <td>
    <img src="ShowTimes.gif" width="130" height="39" border="0">
    </td>
    </tr>
    </csp:while>
    </table>
</body> </html>

Click generated description: handson.gif for the location of ShowTimes.gif and instructions on where to place the file so that TopPicks.csp displays it.

FeedbackOpens in a new tab