<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="AjaxCart._Default" %>

<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <radA:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
            <div>
                <table cellpadding="5" border="0">
                    <tr>
                        <td>
                            Quantity</td>
                        <td>
                            Item</td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:TextBox ID="tbQuantity" runat="server" Width="30px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rfvQty" runat="server" ControlToValidate="tbQuantity"
                                Display="dynamic" ErrorMessage="Must specify quantity"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cvQty" runat="server" ControlToValidate="tbQuantity" Display="dynamic"
                                ErrorMessage="Must be postitive whole number" Type="Integer" ValueToCompare="0"
                                Operator="GreaterThan"></asp:CompareValidator>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlItems" runat="server">
                                <asp:ListItem Text="Hammer" Value="10" />
                                <asp:ListItem Text="Nail" Value="0.01" />
                                <asp:ListItem Text="Snail" Value="1" />
                            </asp:DropDownList>
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;&nbsp;
                            <asp:Button ID="pbAdd" runat="server" Text="Add" OnClick="pbAdd_Click" /></td>
                    </tr>
                </table>
                <br />
                <hr />
                Cart:
                <br />
                <asp:ListBox ID="lbItemsInCart" runat="server" Width="219px" Height="195px"></asp:ListBox>
                <br />
                <br />
                <asp:Label ID="lblTotal" runat="server" Text='<%# String.Format( "Total: {0:c}", Total ) %>'></asp:Label>
            </div>
        </radA:RadAjaxPanel>
    </form>
</body>
</html>
