HtmlElement.OuterText Property


Gets or sets the current element's text.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public string OuterText { get; set; }

Property Value

Type: System.String

The text inside the current element, and in the element's children.

Exception Condition

You cannot set text outside of this element.

If you attempt to assign HTML to an element with OuterText, the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the InnerHtml property, OuterText will return all of the text in that HTML with the markup removed.

Assigning a value to OuterText will destroy any child elements that belong to the element.

.NET Framework
Available since 2.0
Return to top