XHTML, Section 508 and WAI Validation
We placed a priority on Accessiblity and
Validation when building Basic Date Picker. Our goal was to validate
"Out-of-the-Box", although in our research we found that it is impossible
to create a valid Web Form out-of-the-box, with or without Basic Date
The good news is, with a little work it is
possible create a WebForm that will validate.
A blank Web Form (ASP.NET 1.1) will not
validate. The best technique we found to correcting the HTML requires
developers to "adjust" the HTML before the server sends to the
The problems with ASP.NET Web Accessiblity and HTML validation are well documented by Millan Negovan at ASPnetResources.com.
We use Millan's IHttpModule Page Filter
approach to intercept the HTML prerender and correct any issues. See Producing XHTML Compliant Pages With Response
Filters for detailed information.
The PageFilter corrects all issues except one:
- By default Basic Date Picker renders a <style>
block to include the required external StyleSheet
(basicdatepicker.css). We did not want to rely on the PageFilter Regular
Expression parsing to move the <style> tag from the <body> to the
page <head>, so we set the .RenderStyleSheet property to "None" and place/include
the <style> block manually into the <head> of the page.
Other important notes:
- Ensure you have a valid DOCTYPE. We use xhtml 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- Ensure you add a <label> tag to satisfy WAI
<label for="BasicDatePicker1_textBox">Sample Date:</label>