Export (0) Print
Expand All

HtmlTextWriter.TagRightChar Field

Represents the closing angle-bracket (>) of an HTML tag.

[Visual Basic]
Public Const TagRightChar As Char
[C#]
public const char TagRightChar;
[C++]
public: const __wchar_t TagRightChar;
[JScript]
public var TagRightChar : Char;

Example

[Visual Basic, C#, C++] The following example uses a version of the Write method to end the opening tag of an Img element using the TagRightChar constant.

[Visual Basic] 
' Create a manually rendered tag.
writer.WriteBeginTag("img")
writer.WriteAttribute("alt", "AtlValue")
writer.WriteAttribute("myattribute", "No "encoding " required", False)
writer.Write(HtmlTextWriter.TagRightChar)
writer.WriteEndTag("img")
writer.WriteLine()

writer.Indent -= 1
writer.RenderEndTag()

[C#] 
// Create a manually rendered tag.
writer.WriteBeginTag("img");
writer.WriteAttribute("alt", "AtlValue");
writer.WriteAttribute("myattribute", "No "encoding " required", false);
writer.Write(HtmlTextWriter.TagRightChar);
writer.WriteEndTag("img");
writer.WriteLine();

writer.Indent--;
writer.RenderEndTag();

[C++] 
// Create a manually rendered tag.
writer->WriteBeginTag(S"img");
writer->WriteAttribute(S"alt", S"AtlValue");
writer->WriteAttribute(S"myattribute", S"No "encoding " required", false);
writer->Write(HtmlTextWriter::TagRightChar);
writer->WriteEndTag(S"img");
writer->WriteLine();

writer->Indent--;
writer->RenderEndTag();

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HtmlTextWriter Class | HtmlTextWriter Members | System.Web.UI Namespace

Show:
© 2014 Microsoft