Dynamicweb 8 Documentation
SetTag(String,String,Boolean) Method
Example 

The name of the template tag, <--@NameOfTag-->.
The value replacing the template tag specified in the name.
if set to true the value is HTML encoded.
Specifies a tag name and value for the instance of the template object.
Syntax
'Declaration
 
Public Overloads Sub SetTag( _ 
   ByVal name As String, _ 
   ByVal value As String, _ 
   ByVal htmlEncode As Boolean _ 
) 
public void SetTag( 
   string name,
   string value,
   bool htmlEncode 
)

Parameters

name
The name of the template tag, <--@NameOfTag-->.
value
The value replacing the template tag specified in the name.
htmlEncode
if set to true the value is HTML encoded.
Example
Simple template usage exampleSimple template usage example
'Load a template from /Files/Templates/MyFolder/MyTemplate.html
Dim t As New Template("MyFolder/MyTemplate.html")
'Set a tag value 
t.SetTag("MyTag", "Hello <b>world!</b>", True)
'Return the parsed template with the value of MyTag html encoded.
Return t.Output
//Load a template from /Files/Templates/MyFolder/MyTemplate.html
Rendering.Template t = new Template("MyFolder/MyTemplate.html");
//Set a tag value 
t.SetTag("MyTag", "Hello <b>world!</b>", true);
//Return the parsed template with the value of MyTag html encoded.
return t.Output();
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
Overload List

Send Feedback