Checkout wizard : Wizard « Asp Control « ASP.Net

ASP.Net
1. ADO.net Database
2. Ajax
3. Asp Control
4. Collections
5. Components
6. Data Binding
7. Development
8. File Directory
9. HTML Control
10. Language Basics
11. Login Security
12. Mobile Control
13. Network
14. Page
15. Request
16. Response
17. Server
18. Session Cookie
19. Sitemap
20. Theme Style
21. User Control and Master Page
22. Validation by Control
23. Validation by Function
24. WebPart
25. WPF
26. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.Net » Asp Control » Wizard 
Checkout wizard


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Checkout" %>

<!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 id="Head1" runat="server">
    <title>Chapter 20 Checkout Wizard</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <strong>Halloween Superstore - Checkout</strong><br />
        <br />
        <asp:Wizard ID="wizCheckout" runat="server"  Width="739px" 
            DisplayCancelButton="True"
            OnCancelButtonClick="wizCheckout_CancelButtonClick" >
            <WizardSteps>
                <asp:WizardStep ID="WizardStep1" runat="server"
                    Title="Step 1: Contact Info">
                    Please enter your contact information:<br /><br />
                    <table>
                      <tr>
                        <td>
                            First Name:
                        </td>
                        <td>
                            <asp:TextBox ID="txtFirstName" runat="server"
                                Height="22px" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                ID="RequiredFieldValidator1" 
                                runat="server" 
                                ControlToValidate="txtFirstName"
                                ErrorMessage="First Name is required."></asp:RequiredFieldValidator>
                        </td>
                      </tr>
                      <tr>
                        <td>
                            Last name:
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server"
                                Height="22px" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                ID="RequiredFieldValidator2" 
                                runat="server" 
                                ControlToValidate="txtLastName"
                                ErrorMessage="Last Name is required."></asp:RequiredFieldValidator>
                        </td>
                      </tr>
                      <tr>
                        <td>
                            Email:
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server"
                                Height="22px" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                ID="RequiredFieldValidator3" 
                                runat="server" 
                                ControlToValidate="txtEmail"
                                ErrorMessage="Email is required."></asp:RequiredFieldValidator>
                        </td>
                      </tr>
                    </table>
                </asp:WizardStep>
                <asp:WizardStep ID="WizardStep2" runat="server"
                     Title="Step 2: Shipping Method">
                    Please select a shipping method:<br /><br />
                    <asp:RadioButton ID="rdoUPSGround" runat="server"
                        Checked="True" GroupName="ShipVia" Text="UPS Ground" />
                    <br />
                    <asp:RadioButton ID="rdoUPS2Day" runat="server"
                        GroupName="ShipVia" Text="UPS Second Day" />
                    <br />
                    <asp:RadioButton ID="rdoFedEx" runat="server"
                        GroupName="ShipVia" Text="Federal Express Overnight" />
                    <br />
                </asp:WizardStep>
                <asp:WizardStep ID="WizardStep3" runat="server"
                    Title="Step 3: Credit Card Info">
                    Please enter your credit card information:<br />
                    <br />
                    <table>
                      <tr>
                        <td>
                            <asp:ListBox ID="lstCardType"
                                runat="server">
                                <asp:ListItem Selected="True"
                                    Value="VISA">Visa</asp:ListItem>
                                <asp:ListItem Value="MC">
                                    MasterCard</asp:ListItem>
                                <asp:ListItem Value="AMEX">
                                    American Express</asp:ListItem>
                            </asp:ListBox>
                        </td>
                        <td>
                            Card Number:
                        </td>
                        <td>
                            <asp:TextBox ID="txtCardNumber" runat="server"
                                Height="22px" Width="262px"></asp:TextBox>
                        </td>
                      </tr>
                      <tr>
                        <td>
                            Expiration Date:
                        </td>
                        <td valign="middle">
                            <asp:DropDownList ID="ddlExpirationMonth"
                                runat="server">
                                <asp:ListItem Value="1">January</asp:ListItem>
                                <asp:ListItem Value="2">February</asp:ListItem>
                                <asp:ListItem Value="3">March</asp:ListItem>
                                <asp:ListItem Value="4">April</asp:ListItem>
                                <asp:ListItem Value="5">May</asp:ListItem>
                                <asp:ListItem Value="6">June</asp:ListItem>
                                <asp:ListItem Value="7">July</asp:ListItem>
                                <asp:ListItem Value="8">August</asp:ListItem>
                                <asp:ListItem Value="9">September</asp:ListItem>
                                <asp:ListItem Value="10">October</asp:ListItem>
                                <asp:ListItem Value="11">November</asp:ListItem>
                                <asp:ListItem Value="12">December</asp:ListItem>
                            </asp:DropDownList>&nbsp;
                            <asp:DropDownList ID="ddlExpirationYear"
                                runat="server">
                            </asp:DropDownList>
                        </td>
                      </tr>
                    </table>
                </asp:WizardStep>
            </WizardSteps>
        </asp:Wizard>
    </div>
    </form>
</body>
</html>

File: Default.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Checkout : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            wizCheckout.ActiveStepIndex = 0;

            int year = DateTime.Now.Year;
            for (; year < DateTime.Now.Year + 6; year++)
                ddlExpirationYear.Items.Add(year.ToString());
        }
    }

    protected void wizCheckout_CancelButtonClick(object sender, EventArgs e)
    {
        wizCheckout.ActiveStepIndex = 0;
        txtFirstName.Text = "";
        txtLastName.Text = "";
        txtEmail.Text = "";
        rdoUPSGround.Checked = true;
        rdoUPS2Day.Checked = false;
        rdoFedEx.Checked = false;
        lstCardType.SelectedIndex = 0;
        txtCardNumber.Text = "";
        ddlExpirationMonth.SelectedIndex = 0;
        ddlExpirationYear.SelectedIndex = 0;
    }
}

 
Related examples in the same category
1. Basic Wizard
2. how to set up and use a wizard.
3. Wizard template
4. Checkout wizard (VB)
5. Wizard ActiveStepIndex
6. Wizard history
7. Use WizardStep
8. Wizard Demo
9. Wizard finish button click event
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.