HtmlControlType
HtmlControlType enumeration
Art der Dokumentknoten, die aus HTML importierte <input>- und <select>-Elemente darstellen.
public enum HtmlControlType
Werte
Name | Wert | Beschreibung |
---|---|---|
FormField | 0 | Ein Formularfeld. |
StructuredDocumentTag | 1 | Ein strukturiertes Dokument-Tag |
Beispiele
Zeigt, wie der bevorzugte Typ von Dokumentknoten festgelegt wird, die importierte <input>- und <select>-Elemente darstellen.
const string html = @"
<html>
<select name='ComboBox' size='1'>
<option value='val1'>item1</option>
<option value='val2'></option>
</select>
</html>
";
HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
htmlLoadOptions.PreferredControlType = HtmlControlType.StructuredDocumentTag;
Document doc = new Document(new MemoryStream(Encoding.UTF8.GetBytes(html)), htmlLoadOptions);
NodeCollection nodes = doc.GetChildNodes(NodeType.StructuredDocumentTag, true);
StructuredDocumentTag tag = (StructuredDocumentTag) nodes[0];
Siehe auch
- namensraum Aspose.Words.Loading
- Montage Aspose.Words