Skip to main content

CSP Elements: Scripts

Script tags allow you to insert ObjectScript (or Caché Basic) code blocks into your CSP page. The Caché Compiler adds the code contained in a script tag to the onPageBody method of the page class. The script then executes along with the other code in onPageBody. The placement of scripts and expressions within a .csp file determines their placement within onPageBody and ultimately the order in which they execute.

Add the scripts and expressions shown below to MySamplePage.CSP between <body> and </body>. You can remove any other code from between <body> and </body>.


<body>
<script language="Cache" runat="Server">
  set x = 3+4
</script>
<script language="Cache" runat="Server">
  set y = x+1
</script>
<p>X + Y is #(x + y)#</p>
</body>

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

generated description: scripts20142

FeedbackOpens in a new tab