If-then-clause in conditional

LanguageCommand
ASP.NET Server Control<ugc:When runat="server">
JSP Custom Tag<ugc:When>
TCDL tag<tcdl:When>

Description: The "if-then" part of a conditional statement. This element must be the first child of a <Choose> child element, and may be followed by any number of <When> sibling elements, and may then be followed by an <Otherwise> sibling element. The contents of the various <When> elements specify what to execute and/or display if the condition of that <When> element holds; the optional <Otherwise> sibling element specifies what to execute and/or display if none of the conditions in any of the <When> elements holds.

Attributes:
Attribute name (JSP or TCDL)Description
test (JSP or TCDL) or Test (ASP.NET)

The expression to evaluate; specifically, a comparison of context variables (pagecontext variables in JSP, or variables from HttpContext.Current.Items in .NET).

If the expression evaluates to true, the contents of this <When> element are executed and/or displayed; otherwise, all sibling <When> elements are evaluated (if any). If none of the conditions in any of the <When> elements hold, the contents of the <Otherwise> sibling element are executed and/or displayed, or if no <Otherwise> element exists, nothing happens.