50 users using DBSP now!
home -> documentation -> language reference -> REDIRECT tag
 

Description

The REDIRECT tag is used to interrupt the current page interpretation and jump into the new page specified.


Syntax


<#REDIRECT [EXPRESSION=""] DOC="document" | URL="anURL"/>



EXPRESSION You could specify in the EXPRESSION property a Boolean expression and the REDIRECT tag will become conditional, which means that the redirection will be executed if and only if the Boolean expression evaluates to true.
DOC Specify in the DOC property the document that will be displayed instead of the actual one. This property is primarily intended for DBSP documents.
URL Specify in the DOC property a document that is outside of the current site or server. If this property is specified, the redirection will act as an HTML redirect.


Note: All the code interpreted before the REDIRECT tag will be discarded and substituted by the content located in the new page. However, all the database modifications made with the DATASET or QRYEXEC tag before the redirection will not be discarded (in the database context, will not be rolled back).

Examples

Example 1. A simple redirection

This example shows an unconditional redirection.

Source code
Test example


Example 2. Conditional redirection.

In this example, the application displays the correct page according the user profile.

Source code
Test example