Skip to main content

Creating a Page via Code

generated description: pagedefinition.gif

So far, we have defined Web pages by creating CSP files using CSP tags. Caché automatically compiles these files into page classes. While this is a powerful approach, it's only half the story.

We can also create pages by coding page classes directly. This may be a more natural approach for programmers (as opposed to page designers, who prefer the HTML-based approach of CSP files.)

Note that this distinction only applies to how pages are defined. In either case, the same compiled form of the page is produced and the same runtime behavior results.

The only way that we can really distinguish these two approaches from the “outside” is that code-based pages have a .cls extension, instead of .csp.

Let's look at how we create a page via code.

FeedbackOpens in a new tab