CSP Tags: <csp:if>
The <csp:if>, <csp:elseif>, and <csp:else> tags create a conditional structure within the flow of the CSP page.
Add the code shown below to MySamplePage.CSP between <body> and </body>. The code recreates the functionality of OddEvenTest using conditionals. The conditionals are within a loop that executes ten times. You can remove all other code from between <body> and </body>.
<body>
<ul>
<csp:loop counter="i" from="1" to="10" step="1">
<csp:if condition="i#2=0">
<li>even</li>
<csp:else condition="i#2'=0">
<li>odd</li>
</csp:else>
</csp:if>
</csp:loop>
</ul>
</body>
Click View —> Web Page to view MySamplePage.CSP in a Web browser.