The current AspNet controls suffer from at least two major defects that often have force me to rewrite my own compliant version of their controls. The defects are simple:
- Extensive use of <span> which is defined as allowing: <!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
- they should be using <div> which is defined as <!ENTITY % flow "%block; | %inline;">, all of the same items as span PLUS block items, namely: <!ENTITY % block "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
- Allowing AccessKey on most controls.
So it is impossible to put a <p>, <div>,<table> on a asp:Panel and have valid XHTML because panel renders with a <span>.
If you are old school, hard-core HTML savy, it’s not a big issue – you just use <div runat=”server”> instead of asp:panel, etc. The problem is that most C# developers are not hard-core HTML savy so they produce pages that fail validation and the likes of me have to grunt thru a refactoring of their pages…