Clicking on the Purchase button on the Cart page brings you to the Purchase page. This page is used to gather
billing and shipping information from the customer. It has a layout table with a
TextBox controls, a couple of
RadioButtonLists, a Buy Now button, and a bunch of
associated validation controls.
The first row of the layout table is just a heading. The second row collects the
Name. This is a required field, so it has a
<table border="0" class="TableRowHeading"> <tr> <td colspan="4"> Billing Information </td> </tr> <tr> <td>Name</td> <td colspan="4"> <asp:TextBox ID="txtName" runat="server" Width="250" /> <asp:RequiredFieldValidator ID="rfName" runat="server" ControlToValidate="txtName" Display="Dynamic" ErrorMessage="Name is a required field." CssClass="ValidationError">*</asp:RequiredFieldValidator></td> </tr>
Figure 10-11. Here's what the cart page looks like after you've added some items to the cart.
All the validation controls on this page will use Dynamic Display, so room will
only be allocated on the page if it is necessary to display the validation text. For
this and all the other validation controls, the validation text is simply an
asterisk to display next to the invalid control. A
ValidationSummary control at the bottom of the page will gather all
ErrorMessages into a single
The next row is the Address, which ...