Element Constructor (String) |
Initializes a new instance of
Element object with the specified HTML markup.
Namespace: MailBee.HtmlAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public Element(
string htmlText
)
Public Sub New (
htmlText As String
)
Parameters
- htmlText
- Type: SystemString
The actual HTML markup of the Element.
Exceptions Remarks htmlText can contain any string including HTML with broken markup, plain text, etc.
MailBee will attempt to parse it even if not all tags are closed, or some tags are closed incorrectly, etc.
Examples
This samples initializes
Element object with certain HTML markup and then
displays the name of the root tag and the inner HTML contents of the specified markup.
using System;
using MailBee.Html;
Element richText = new Element("<html><head><title>Sample header</title></head><body>Short sample<body></html>");
Console.WriteLine("The root tag name is : " + richText.TagName);
Console.WriteLine("The inner HTML source is : " + richText.InnerHtml);
Imports MailBee.Html
Dim richText As New Element("<html><head><title>Sample header</title></head><body>Short sample<body></html>")
Console.WriteLine("The root tag name is : " & richText.TagName)
Console.WriteLine("The inner HTML source is : " & richText.InnerHtml)
See Also