Skip to main content

Using the CSP:Class Tag

To encode the data in a URL, we add a csp:class tag to the CSP page being linked to and specify a value for its encoded attribute:

<html> <body><csp:class encoded=1>

We place this tag near the top of our CSP file for ShowTimes. Now the urls visible on pages linking to ShowTimes will always be encoded.

—ShowTimes.csp—
ShowTimes.csp
<html> <body>
<csp:class encoded=1>
<csp:query 
        name="Times" 
        classname="Cinema.Show" 
        queryname="ShowTimes" 
        P1='#($Get(%request.Data("FilmID",1)))#'>

<table cellpadding=5>
<tr>
    <td><b>Time</b></td>
    <td><b>Theater</b></td>
</tr>
<csp:while condition="Times.Next()">
    <tr>
    <td>#(Times.Get("StartTime"))#</td>
    <td>#(Times.Get("TheaterName"))#</td>

    </tr>
</csp:while>
</table>
</body> </html>
FeedbackOpens in a new tab