.NET 3.5 DataPager Controls and XHTML Compilance
As I put the finishing touches on the new Web Gallery, my final checks for full XHTML 1.1 Transitional compilance are at full steam. One of my goals for the project is to comply (which is against my nature ;)) and still have an operational web site. Part of that included using the new ListView controls, DataPager, and CSS Friendly adapters.
The one that caught me, however, was the DataPager.
“There is no attribute “disabled”.”
The validator was caught up by a line of code generated by the DataPager control’s NextPreviousPagerField.
By default, the NextPreviousPagerField generates hyperlinks and decorates them with disabled=”disabled” when they are invalid. Unfortunately, that’s not XHTML compliant since the “disabled” property doesn’t exist for an “a” tag.
To fix this, add the RenderDisabledButtonsAsLabels=”true” property to your NextPreviousPagerField controls. Instead of “disabled” hyperlinks, this simply generates labels.
Now, we’re compliant: