Dynamicweb 8 Documentation
TagExists Method
Example 

The name of tag to check for.
Checks if a tag exists in the loaded template.
Syntax
'Declaration
 
Public Function TagExists( _ 
   ByVal name As String _ 
) As Boolean
public bool TagExists( 
   string name 
)

Parameters

name
The name of tag to check for.

Return Value

true if the tag is found in the template; otherwise false
Remarks
Used for optimizing performance. If the value of a tag is expensive to render, there is no need to execute the code if the template is not going to use the data.
Example
Use TagExists to avoid expensive operations
Dim t As New Template("MyFolder/MyTemplate.html")
t.SetTag("MyTag", "Hello world!")
If t.TagExists("MyOtherTag") Then
	t.SetTag("MyOtherTag", RunExpensiveOperation())
End If
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Template Class
Template Members

Send Feedback