ASP Net Controls ASP.Net Tutorial

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


  
        
              runat="server" 
        onfinishbuttonclick="OnFinishButtonClick" 
        backcolor="#EFF3FB" 
        font-names="Verdana" 
        font-size="0.8em"
        borderwidth="1px" 
        bordercolor="#B5C7DE" 
        style="font-size: medium; font-family: Verdana;" 
        onactivestepchanged="OnActiveStepChanged">       
              font-size="0.8em" />
                
                      title="One"
            allowreturn="false" 
            runat="server" >
            Welcome to the Wizard example.  This step's AllowReturn property is set 
            to false, so after you leave this step you will not be able to return to it.
                    
                      title="Two" 
            runat="server" >
            
            Please enter your billing information.
            
            Name:
                          id="BillingName" 
              width="226px" 
              height="17px" /> 
            
            E-mail Address:
                          id="EmailAddress" 
              width="224px" 
              height="17px" />
            
            Address Line 1: 
                          id="BillingAddressLine1" 
              width="314px" 
              height="17px" />
            
            Address Line 2: 
                          id="BillingAddressLine2" 
              width="314px" 
              height="17px" />
            
            City: 
                          id="BillingCity" 
              width="155px" 
              height="17px" /> 
            
            State: 
                          id="BillingState" 
              width="75px" 
              height="17px" /> 
            
            ZIP Code: 
                          id="BillingZip" 
              height="17px" />
            
                          id="SeparateShippingCheckBox" 
              text="Please check here if you would like to add a separate shipping address." />
                    
                      title="Three" 
            runat="server" >
            
            Please enter your shipping information.
            
                Name:
                                  id="ShippingName" 
                  height="17px" /> 
                
                Address Line 1: 
                                  id="ShippingAddress1" 
                  width="370px" 
                  height="17px" />
                
                Address Line 2: 
                                  id="ShippingAddress2" 
                  width="370px" 
                  height="17px" />
                
                City: 
                                  id="ShippingCity" 
                  height="17px" /> 
                
                State: 
                                  id="ShippingState" 
                  width="65px" 
                  height="17px" />
                 
                ZIP Code: 
                                  id="ShippingZip" 
                  height="17px" />
          
                      title="Finish"
            runat="server" >
            
                          id="GoBackButton" 
              text="Go Back to Step 2" 
              onclick="OnGoBackButtonClick"
              forecolor="#284E98" 
              font-names="Verdana"
              font-size="1.0em" 
              borderstyle="Solid" 
              borderwidth="1px" 
              bordercolor="#507CD1" 
              backcolor="White" /> 
                    
                      steptype="Complete" 
            title="Complete" 
            id="Complete">
                          id="CompleteMessageLabel" 
              width="408px" 
              height="24px">
            
          
        
 
                  font-names="Verdana"
          font-size="1.0em" 
          borderstyle="Solid" 
          borderwidth="1px" 
          bordercolor="#507CD1" 
          backcolor="White" />
                  horizontalalign="Center" 
          font-size="0.9em" 
          font-bold="True"
          backcolor="#284E98" 
          borderstyle="Solid" 
          bordercolor="#EFF3FB" 
          borderwidth="2px" />
                  horizontalalign="Center"
          font-size="0.8em" 
          forecolor="#000099"
          backcolor="#EFF3FB"
          width="45px" />
        
          Wizard Example
        

      
    
  

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 HelpExampleWizard : System.Web.UI.Page
{
  protected void OnFinishButtonClick(Object sender, WizardNavigationEventArgs e)
  {
    Label tempLabel = (Label)Wizard1.FindControl("CompleteMessageLabel");
    if (tempLabel != null)
    {
      tempLabel.Text = "An e-mail will be sent to " + (EmailAddress.Text.Length == 0 ? "your e-mail address" : EmailAddress.Text) + ".";
    }
  }
  protected void OnGoBackButtonClick(object sender, EventArgs e)
  {
    if (Step1.AllowReturn)
    {
      Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.Step1);
    }
    else
    {
      Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.Step2);
      Response.Write("ActiveStep is set to Step2 because Step1 has AllowReturn set to false.");
    }
  }
  protected void OnActiveStepChanged(object sender, EventArgs e)
  {
    if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.Step3))
    {
      if (this.SeparateShippingCheckBox.Checked)
      {
        Wizard1.MoveTo(this.Step3);
      }
      else
      {
        Wizard1.MoveTo(this.Finish);
      }
    }
  }
}