public TestHtmlConventions() { Editors.IfPropertyIs <string>().UseTextbox(); Editors.IfPropertyIs <bool>().BuildBy(req => new CheckboxTag(req.Value <bool>())); Editors.AddClassForAttribute <FakeRequiredAttribute>("required"); Editors.ModifyForAttribute <FakeMaximumStringLength>((tag, att) => tag.Attr("maxlength", att.MaxLength)); Labels.Always.BuildBy(req => new HtmlTag("span").Text(req.Accessor.Name)); Labels.Always.AddClass("label"); Displays.Always.BuildBy(req => new HtmlTag("span").Text(req.StringValue())); Profile("edit", x => { x.Editors.IfPropertyTypeIs(o => o.CanBeCastTo <TagProfile>()).AddClass("class1"); }); }