If defined

In Dynamciweb HTML templates conditionals are a Dynamicweb specific syntax. In Razor conditionals are regular .NET syntax (C# or VB) and gives full programming capabilities against the template values. 

If/else tags provide a way of outputting conditional information. The template functionality lets you use an If defined tag and an If Not Defined tag. Within both tags you can insert tags valid for the current context (except global tags which can be used everywhere).

If a template tag has a value or does exist, the values within the If Defined tag will be displayed. Otherwise the value within the If Not defined tag will be displayed. Both tags can be used seperately.

@if (Loops.Contains("Loop")) { ... }
<!--@If LoopDefined(Loop)--> ... <!--@EndIf(Loop)

@if (!string.IsNullOrWhiteSpace(GetString("TagName"))) { text to print if condition is met }

Notice: Use GetString inside string.IsNullOrWhiteSpace.

<!--@If [Not] Defined(TagName)--> text to print if condition is met <!--@EndIf(TagName)-->

Notice that the If tags has to end with an EndIf tag in order to work.