Multiview checkout (VB) : Multiview « 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 » Multiview 
Multiview checkout (VB)


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" 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>Checkout MultiView</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:MultiView ID="mvCheckout" Runat="server" ActiveViewIndex="0">
            <asp:View ID="vContact" Runat="server">
                Please enter your contact information:<br /><br />
                <table>
                  <tr>
                    <td>First Name:</td>
                    <td>
                        <asp:TextBox ID="txtFirstName" 
                                     Runat="server"
                                     Width="200px" 
                                     Height="22px"></asp:TextBox>
                        <asp:RequiredFieldValidator
                            ID="RequiredFieldValidator1" 
                            Runat="server" 
                            ErrorMessage="First Name is required."
                            ControlToValidate="txtFirstName">
                        </asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td>Last name:</td>
                    <td><asp:TextBox ID="txtLastName" Runat="server"
                            Width="200px" Height="22px"></asp:TextBox>
                        <asp:RequiredFieldValidator
                            ID="RequiredFieldValidator2" Runat="server" 
                            ErrorMessage="Last Name is required."
                            ControlToValidate="txtLastName">
                        </asp:RequiredFieldValidator>
                    </td>
                  </tr>
                  <tr>
                    <td>Email:</td>
                    <td><asp:TextBox ID="txtEmail" Runat="server"
                            Width="200px" Height="22px"></asp:TextBox>
                        <asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator3" 
                            Runat="server" 
                            ErrorMessage="Email is required."
                            ControlToValidate="txtEmail">
                        </asp:RequiredFieldValidator>
                    </td>
                  </tr>
                </table>
                <br />
                <asp:Button ID="Button1" runat="server"
                    CommandName="NextView" Text="Next" />
            </asp:View>
            <asp:View ID="vShippingMethod" Runat="server">
                <asp:Panel ID="Panel1" Runat="server" Width="492">
                    Please select a shipping method:<br /><br />
                    <asp:RadioButton ID="rdoUPSGround" 
                        Runat="server" 
                        Text="UPS Ground" 
                        GroupName="ShipVia"
                        Checked="True" />
                    <br />
                    <asp:RadioButton ID="rdoUPS2Day" 
                        Runat="server" 
                        Text="UPS Second Day" 
                        GroupName="ShipVia" />
                    <br />
                    <asp:RadioButton ID="rdoFedEx" Runat="server" 
                        Text="Federal Express Overnight" GroupName="ShipVia" />
                    <br />
                </asp:Panel><br />
                <asp:Button ID="Button2" runat="server" 
                    CommandName="PrevView" Text="Previous" />
                <asp:Button ID="Button3" runat="server" 
                    CommandName="NextView" Text="Next" />
            </asp:View>
            <asp:View ID="vCreditCard" Runat="server">
                <asp:Panel ID="Panel2" Runat="server" Width="492px">
                    Please enter your credit card information:<br />
                    <br />
                    <table>
                      <tr>
                        <td><asp:ListBox ID="listCardType"
                                    Runat="server">
                                    <asp:ListItem Value="VISA"
                                        Selected="True">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><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>
                    <br />
                    <asp:Button ID="Button4" runat="server"
                        CommandName="PrevView" Text="Previous" />
                    <asp:Button ID="btnFinish" Runat="server"
                        Height="24px" Text="Finish"
                        CommandName="NextView" />
                </asp:Panel>
            </asp:View>
            <asp:View ID="vFinish" runat="server">
                Here is the data you entered:<br /><br />
                <asp:TextBox ID="txtMessage" runat="server" 
                    Height="182px" TextMode="MultiLine" Width="346px">
                </asp:TextBox><br />
            </asp:View>
        </asp:MultiView></div>
    </form>
</body>
</html>

File: Default.aspx.vb


Partial Class Checkout
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, _
            ByVal e As System.EventArgsHandles Me.Load
        If Not IsPostBack Then
            Dim iYear As Integer
            For iYear = DateTime.Now.Year To DateTime.Now.Year + 5
                ddlExpirationYear.Items.Add(iYear.ToString())
            Next
        End If
    End Sub

    Protected Sub btnFinish_Click(ByVal sender As Object, _
            ByVal e As System.EventArgsHandles btnFinish.Click
        Me.DisplayMessage()
    End Sub

    Protected Sub DisplayMessage()
        Dim sShipVia As String = ""
        If (rdoUPSGround.CheckedThen
            sShipVia = "UPSG"
        ElseIf (rdoUPS2Day.CheckedThen
            sShipVia = "UPS2D"
        ElseIf (rdoFedEx.CheckedThen
            sShipVia = "FEDEX"
        End If

        Dim sMessage As String
        sMessage = _
            "Contact info" & ControlChars.CrLf & _
            "    First name: " & txtFirstName.Text & ControlChars.CrLf & _
            "    Last name: " & txtLastName.Text & ControlChars.CrLf & _
            "    Email: " & txtEmail.Text & ControlChars.CrLf & _
            "Shipping method" & ControlChars.CrLf & _
            "    Ship via: " & sShipVia & ControlChars.CrLf & _
            "Credit card info" & ControlChars.CrLf & _
            "    Type: " & listCardType.SelectedValue & ControlChars.CrLf & _
            "    Number: " & txtCardNumber.Text & ControlChars.CrLf & _
            "    Expiration date: " & ddlExpirationMonth.SelectedValue & "/" & _
                                      ddlExpirationYear.SelectedValue
        txtMessage.Text = sMessage
    End Sub
End Class

 
Related examples in the same category
1. asp:multiview Demo (C#)
2. MultiView Demo
3. asp:MultiView set up
4. Multiview with style
5. Multiview checkout (C#)
6. Multiview with navigation (C#)
7. Multiview with navigation (VB)
8. MultiView ActiveViewIndex Example
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.