Will Microsoft ever make their AspNet Controls (X)HTML Compliant?
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…
Does this help or is it just a sideways run at the problem?
ReplyDeletehttp://www.asp.net/cssadapters/Whitepaper.aspx
I was using a Firefox plugin to validate the XHTML compliance of my ASP.NET pages, and wasn't getting very far until I used this technique: http://msdn.microsoft.com/en-us/library/ms178159.aspx
ReplyDeleteHowever I don't think it will address those particular issues you brought up.