HtmlElement.AppendChild Method (HtmlElement, HtmlElement)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Adds an element at a specified location in the child element collection for the current HTML element.
Namespace: System.Windows.Browser
Assembly: System.Windows.Browser (in System.Windows.Browser.dll)
Syntax
'Declaration
<SecuritySafeCriticalAttribute> _
Public Sub AppendChild ( _
element As HtmlElement, _
referenceElement As HtmlElement _
)
[SecuritySafeCriticalAttribute]
public void AppendChild(
HtmlElement element,
HtmlElement referenceElement
)
Parameters
- element
Type: System.Windows.Browser.HtmlElement
The element to be added.
- referenceElement
Type: System.Windows.Browser.HtmlElement
The location to insert the element. The element is added before referenceElement.
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | referenceElement is not in the child element collection of the current HTML element. |
ArgumentNullException | element is nulla null reference (Nothing in Visual Basic). |
Remarks
The specified element is inserted before referenceElement in the child element collection of the current HTML element. If referenceElement is nulla null reference (Nothing in Visual Basic), element is added to the end of the child element collection.
You can also add an element to the end of the child element collection by using the AppendChild(HtmlElement) method overload.
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.