Welcome to the dotHTML project page!

dotHTML is a library exposing a document object model for Web development in .NET. We aim to provide an easy-to-use class structure for both HTML (work in progress) and CSS (development has not started yet).

Unlike other HTML DOM libraries, which implement the W3C's DOM recommendation in C#, dotHTML takes a class-based approach. Each element is represented as a class, and has a parent-child relationship with other elements. For instance, to create the following HTML:

<b id="bold"><i><u>Bold, italicized, and underlined text.</u></i></b>

...dotHTML can be applied as follows:

// declare element classes
B b = new B();
I i = new I();
U u = new U("Bold, italicized, and underlined text.");

b.ID = "bold"; // set b's ID attribute to "bold"

i.Children.Add(u); // add u as a child element of i
b.Children.Add(i); // add i as a child element of  b

return b.ToString(); // returns the HTML shown above


The project is currently in an alpha-quality state, but does have usable code that passes a suite of unit tests. Further development and refinements are underway.

As a start-out project, we are in need of contributors - contact Don_HH2K (over on the People tab) if you would be interested in further developing and/or testing the library, writing documentation, or just helping out.

Last edited Aug 12, 2012 at 10:28 PM by Don_HH2K, version 3