System.Windows.Forms.HtmlElement.OuterHtml Property

Gets or sets the current element's HTML code.

Syntax

public string OuterHtml { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Whereas HtmlElement.InnerHtml will return all HTML contained in the current element excluding the current element's surrounding tags, HtmlElement.OuterHtml includes the current element's tag as well as the HTML that tag contains, for example:

<HTML>

<BODY>

<DIV id="div1">

Hello

<DIV id="div2">

World

<DIV id="div3">

How are you?

</DIV>

</DIV>

</DIV>

</BODY>

</HTML>

In this example, calling HtmlElement.OuterHtml on div2 will return:

<DIV id="div2">

World

<DIV id="div3">

How are you?

</DIV>

</DIV>

Calling HtmlElement.InnerHtml will return:

World

<DIV id="div3">

How are you?

</DIV>

If you assign a new value to HtmlElement.OuterHtml, the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned.

Requirements

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