Html Represents an html attribute. An attribute like a class should allow multiple values and should be additive. Initializes a new instance of the class. Initializes a new instance of the class. The name. The value. Initializes a new instance of the class. The name value pair separated by an equals sign. Gets or sets the name of the attribute. The name of the attribute. Gets or sets the value of the attribute. The value of the attribute. Exception that is thrown when the same attribute is attempted to be added multiple times on the same element. Initializes a new instance of the class. The message. The args. Represents a method that returns a value based on the target. Represents a simple html element. This is the base class for any class that wants to render itself as html. Defines a contract for any implementor that can render itself to a TextWriter and/or Stream. Renders the specified text. The text. Renders the specified stream. The stream. Renders the specified XML. The XML. Renders the specified HTML. The HTML. Renders the specified writer. The writer. Renders the specified HTML. The HTML. Renders the specified XML writer. The XML writer. Renders the html to the TextWriter instance. The TextWriter instance to which the html is written. Renders the html to the Stream instance. The Stream to which the html is written. Returns a that represents the current . Internally, this creates a StringWriter, calls the Render(TextWriter writer) method and returns the result. A that represents the current . Initializes a new instance of the class. Initializes a new instance of the class. Name of the tag. string expected = "Hello"; string actual = new Element("span") .Update("Hello")).ToString(); Assert.AreEqual(expected, actual); Initializes a new instance of the class. Name of the tag. The child elements. string expected = "Hello"; string actual = new Element("span", new Element("b") .Update("Hello")).ToString(); Assert.AreEqual(expected, actual); Initializes a new instance of the class. Name of the tag. The name value pair separated by an equals sign. eg: height=520px;width=100%;border=0; The child elements. Determines whether the specified name has attribute. The name. true if the specified name has attribute; otherwise, false. Renders the attributes. The writer. Renders the start tag. The HTML. Renders the children. The HTML. Renders the end tag. The HTML. Renders the content. The HTML. Renders this element to the html writer. The html writer this element and it's children are rendered. string expected = @"Hello World"; string actual = ""; using (StringWriter writer = new StringWriter()) using (HtmlTextWriter html = new HtmlTextWriter(writer)) { new Element("span") .Update("Hello World") .Render(html); actual = writer.ToString(); } Assert.AreEqual(expected, actual); Replaces the content of this element with innerHtml The content to set as the inner html of this element. This element with it's content updated to the specified html. string expected = @"Hello World"; string actual = new Element("span").Update("Hello World").ToString(); Assert.AreEqual(expected, actual); Replaces the content of this element with innerHtml The inner HTML format. The args. Inserts the elements at index zero and returns the updated element. The child elements to insert. The current instance with the inserted elements Inserts the elements at the specified index and returns the updated element. The index where the elements are inserted. The child elements to insert. The current instance with the inserted elements Inserts the specified tag name. Name of the tag. The child elements. Creates a new element with the specified tagName, attributes, and childElements, inserts the element at right below the current element and returns the newly created element. Name of the tag. The attributes. The child elements. The element that was inserted. Adds the specified name value pair separated by an equals sign. The name value pair separated by an equals sign. eg: class=required;width=100%;border=0; Adds the specified attribute name. Name of the attribute. The attribute value. The args. Adds the specified attribute name. Name of the attribute. The attribute value. Adds the specified attributes. The attributes. Removes the specified attribute. Name of the attribute to remove. The element with the attribute removed. Performs an implicit conversion from to . The element. The result of the conversion. Appends the specified child elements. The child elements. Adds the style. The name value pairs separated by semi colons. Adds the style. The name. The value. Adds the CSS classes. The CSS class names separated by spaces. For example, yourElement.AddCssClasses("required dataentry") will produce <yourElement class="required dataentry"></yourElement>. The current instance with the added css class. Gets or sets the attribute name. If the attribute does not exist it is added, otherwise it is updated. Gets the name of the tag. This can only be set in the ctor. The name of the tag. Gets the child elements. The child elements. Gets or sets the inner HTML of the element. The inner HTML of the element. Gets the attributes for the element. This returns a readonly collection. Gets the css styles. The styles. Gets or sets the CSS classes. The CSS classes. List of elements. This can be used to render a list of sibling elements. For example, String blah = new ElementList(new Element("p").Update("test"), new Element("b").Update("poop")) would render

test

poop
Initializes a new instance of the class. The sibling elements. Renders the specified HTML. The HTML. Renders the specified XML. The XML. Renders the html to the TextWriter instance. The Render(TextWriter) method will use an HtmlTextWriter instance to ultimately perform the rendering. The TextWriter instance to which the html is written. Renders the html to the Stream instance. The Stream to which the html is written. Returns a that represents the current . Internally, this creates a StringWriter, calls the Render(TextWriter writer) method and returns the result. A that represents the current . Performs an implicit conversion from to . The elements. The result of the conversion. This class wraps a behind the interface. Identifies methods used by the rendering system for writing data to streams. This was created strictly due to the differences between an XmlTextWriter and the other flavor of TextWriters like the StringWriter and HtmlTextWriter. Writes the specified s. The s. Writes the end tag. Name of the tag. Writes the begin tag. Name of the tag. Writes the attribute. The name. The value. Writes the specified c. The c. Closes the tag. Initializes a new instance of the class. The HtmlTextWriter that will be doing the work. Closes a tag. Writes an to the stream. Writes a string to the underlying HtmlTextWriter. The string to render. Writes an end tag. Name of the end tag. Writes an attribute. The attribute name. The attribute value. Writes a begin tag. Name of the tag. Writes the specified char to the stream. The char to write. Represents a special element used for literal text. Using this element allows the use of strings to act as Elements. So "Hello World" can become an simply by wrapping it in a TextElement like this: new TextElement("Hello World") Initializes a new instance of the class. The text. Renders this element to the html writer. The html writer this element and it's children are rendered. string expected = @"Hello World"; string actual = ""; using (StringWriter writer = new StringWriter()) using (HtmlTextWriter html = new HtmlTextWriter(writer)) { new Element("span") .Update("Hello World") .Render(html); actual = writer.ToString(); } Assert.AreEqual(expected, actual); Gets the text. The text. Wraps an XmlWriter so that it conforms to the IWriter interface. Initializes a new instance of the XmlWriterWrapper class. Closes the tag. This does nothing for the Writes the specified string to the underlying , calls the WriteRaw method. The string to write. Writes the begin tag. Name of the tag. Writes the end tag. Name of the tag. Writes the attribute. The name. The value. Writes the specified c. Calls WriteRaw on the underlying The c.