Skip to main content

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>.

<csp:loop counter="i" from="1" to="10" step="1">
  <csp:if condition="i#2=0">
   <csp:else condition="i#2'=0">

Click View —> Web Page to view MySamplePage.CSP in a Web browser.

generated description: ifelse20142

FeedbackOpens in a new tab