For example, we have some CSS rules to define our form layout. We use the following markup:
<div class="foo">
<label class="bar req">Name<em>*</em></label>
<span>
<asp:TextBox runat="server"/>
<label>First</label>
</span>
<span>
<asp:TextBox runat="server"/>
<label>Last</label>
</span>
<div class="clear"></div>
</div>
In my opinion, this is perfectly fine markup. Following these rules is not a burden since you're supposed to worry about clean, correct markup anyway. It's being suggested that we "enforce" these rules with a control that looks something like the following:
<x:FormField runat="server" Label="Name" Required="True">
<x:TextBox runat="server" hint="First"/>
<x:TextBox runat="server" hint="Last"/>
</x:FormField>
My instinct tells me that XHTML markup is our friend, not our enemy. Two questions:
- Am I completely off base to resist making all these custom controls just to emit markup?
- If you agree with me, what reasons would you give?