Adds a new comment node to the child list of this element.
[Visual Basic] Public Function AddComment( _ ByVal comment As String _ ) As XmlComment [C#] public XmlComment AddComment( string comment ); [C++] public: XmlComment* AddComment( String* comment ); [JScript] public function AddComment( comment : String ) : XmlComment;
The newly created comment node.
Exception Type | Condition |
---|---|
ArgumentException | If text is null or contains the character sequence "-->" in any position. |
An exception is thrown if text contains the caracter sequence "-->" in any position (that sequence is reserved to indicate the end of a comment).
XmlContainer Class | XmlContainer Members | System.Xml Namespace