<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="HelpExampleWizard" %>
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);
}
}
}
}