Conforming to Standards


The e-commerce application is standards friendly. It was written to conform to the XHTML 1.0 Transitional standard. You'll notice that the footer includes an icon from the World Wide Web Consortium (W3C) that indicates that the website has successfully passed their XHTML 1.0 Transitional validator (see Figure 34.9).

Figure 34.9. XHTML 1.0 Transitional W3C icon.


You can validate any page against the W3C validator by visiting http://validator.w3.org.

The e-commerce application does not use HTML tables for layout. All page layout is performed with Cascading Style Sheets. For example, the Store.master Master Page contains three <div> tags that represent the three page columns. The three columns are laid out from left to right with the following three CSS classes:

.leftColumn {     float:left;     width:100px;     padding:5px; } .middleColumn {     float:left;     width:450px;     border-left:solid 1px blue;     padding:8px; } .rightColumn {     float:right;     width:200px;     border-left:solid 1px blue;     border-bottom:solid 1px blue;     padding:5px; } 


Furthermore, the e-commerce application was designed to be accessible to persons with disabilities. All images include an ALT attribute. All form elements are explicitly associated with a label. For example, the input field for a product name is created with the following Label and TextBox controls:

<asp:Label      Text="Name:"   AssociatedControl   Runat="server" /> <asp:TextBox      Text='<%# Bind("Name") %>'   Runat="server" /> 


The AssociatedControlID property is used to explicitly associate the Label control with the TextBox control.

Web Standards Note

To learn more about how to make accessible ASP.NET 2.0 websites, see my article at the Microsoft MSDN website, "Building ASP.NET 2.0 Web Sites Using Web Standards."





ASP. NET 2.0 Unleashed
ASP.NET 2.0 Unleashed
ISBN: 0672328232
EAN: 2147483647
Year: 2006
Pages: 276

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net