I am developing a HTML form designer that needs to generate static HTML and show this to the user. I keep writing ugly code like this:
public string GetCheckboxHtml() { return ('<input type='checkbox' name='somename' />'); }
Isn’t there a set of strongly typed classes that describe html elements and allow me to write code like this instead:
var checkbox = new HtmlCheckbox(attributes); return checkbox.Html();
I just can’t think of the correct namespace to look for this or the correct search term to use in Google.
Well, if you download the ASP.NET MVC DLL’s (which you can use in any type of project… including Console apps)… then you can use the many HTML helpers they have.