Skip to main content

Adding an Anchor Tag

Next, we add an anchor (a) tag to specify the URL of the page to display when the user clicks on this image:

<a href='ShowTimes.csp?FilmID=#(FilmList.Get("ID"))#'>

It contains a page (ShowTimes.csp), the name half of a name-value pair (FilmID=), and a value, which is taken from the ID element of the TopFilms query.

—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>
    <a href='ShowTimes.csp?FilmID=#(FilmList.Get("ID"))#'>
    <img src="ShowTimes.gif" width="130" height="39" border="0">
    </a>
    </td>
    </tr>
</csp:while>
</table>
</body> </html>
FeedbackOpens in a new tab