Wizard 类

定义

提供导航和用户界面 (UI),以跨多个步骤收集相关数据。Provides navigation and a user interface (UI) to collect related data across multiple steps.

public ref class Wizard : System::Web::UI::WebControls::CompositeControl
[System.ComponentModel.Bindable(false)]
public class Wizard : System.Web.UI.WebControls.CompositeControl
[<System.ComponentModel.Bindable(false)>]
type Wizard = class
    inherit CompositeControl
Public Class Wizard
Inherits CompositeControl
继承
派生
属性

示例

下面的代码示例演示如何定义一个 Wizard 控件以收集用户的名称和地址,并提供用于输入单独的装运地址的选项。The following code example demonstrates how to define a Wizard control to collect a user's name and address, with the option to enter a separate shipping address. 如果用户未选择 SeparateShippingCheckBox,因而发出了添加单独的寄送地址的请求,则 Wizard 控件会直接从移动 Step2FinishIf the user does not select SeparateShippingCheckBox, thereby issuing a request to add a separate shipping address, the Wizard control moves directly from Step2 to Finish. 在该 Finish 步骤中,用户可以选择返回到控件的开头, Wizard 方法是单击 " GoBackButton"; 但是,它会使用户进入, Step2 因为的 AllowReturn 属性 Step1 被设置为 falseOn the Finish step, the user has the option to return to the beginning of the Wizard control by clicking GoBackButton; however, it takes the user to Step2 because the AllowReturn property for Step1 is set to false.

重要

此示例具有一个接受用户输入的文本框,这是一个潜在的安全威胁。This example has a text box that accepts user input, which is a potential security threat. 默认情况下,ASP.NET 网页验证用户输入是否不包含脚本或 HTML 元素。By default, ASP.NET Web pages validate that user input does not include script or HTML elements. 有关详细信息,请参阅脚本侵入概述For more information, see Script Exploits Overview.

<%@ Page Language="C#" CodeFile="WizardClass.cs" Inherits="WizardClasscs_aspx" %>

<!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>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">    
      <asp:Wizard id="Wizard1" 
        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">       
      <StepStyle forecolor="#333333" 
        font-size="0.8em" />
        <WizardSteps>        
          <asp:WizardStep id="Step1" 
            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.
          </asp:WizardStep>          
          <asp:WizardStep id="Step2"
            title="Two" 
            runat="server" >
            <!-- ... Put UI elements here ... -->
            Please enter your billing information.
            <br />
            Name:<br />
            <asp:TextBox runat="server" 
              id="BillingName" 
              width="226px" 
              height="17px" /> 
            <br />
            Email Address:<br />
            <asp:TextBox runat="server" 
              id="EmailAddress" 
              width="224px" 
              height="17px" />
            <br />
            Address Line 1: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine1" 
              width="314px" 
              height="17px" />
            <br />
            Address Line 2: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine2" 
              width="314px" 
              height="17px" />
            <br />
            City: <br />
            <asp:TextBox runat="server" 
              id="BillingCity" 
              width="155px" 
              height="17px" /> 
            <br />
            State: <br />
            <asp:TextBox runat="server" 
              id="BillingState" 
              width="75px" 
              height="17px" /> 
            <br />
            ZIP Code: <br />
            <asp:TextBox runat="server" 
              id="BillingZip" 
              height="17px" />
            <br /><br />
            <asp:CheckBox runat="server" 
              id="SeparateShippingCheckBox" 
              text="Please check here if you would like to add a separate shipping address." />
          </asp:WizardStep>          
          <asp:WizardStep id="Step3" 
            title="Three" 
            runat="server" >
            <!-- Gather the shipping address in this step if CheckBox1 was selected. -->
            Please enter your shipping information.
            <br />
                Name:<br />
                <asp:TextBox runat="server" 
                  id="ShippingName" 
                  height="17px" /> 
                <br />
                Address Line 1: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress1" 
                  width="370px" 
                  height="17px" />
                <br />
                Address Line 2: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress2" 
                  width="370px" 
                  height="17px" />
                <br />
                City: <br />
                <asp:TextBox runat="server" 
                  id="ShippingCity" 
                  height="17px" /> 
                <br />
                State: <br />
                <asp:TextBox runat="server" 
                  id="ShippingState" 
                  width="65px" 
                  height="17px" />
                <br /> 
                ZIP Code: <br />
                <asp:TextBox runat="server" 
                  id="ShippingZip" 
                  height="17px" />
          </asp:WizardStep>
          <asp:WizardStep id="Finish" 
            title="Finish"
            runat="server" >
            <!-- Put UI elements here for the Finish step. -->
            <asp:Button 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" /> 
          </asp:WizardStep>          
          <asp:WizardStep runat="server" 
            steptype="Complete" 
            title="Complete" 
            id="Complete">
            <asp:Label runat="server" 
              id="CompleteMessageLabel" 
              width="408px" 
              height="24px">
            </asp:Label>
          </asp:WizardStep>
        </WizardSteps> 
        <NavigationButtonStyle forecolor="#284E98" 
          font-names="Verdana"
          font-size="1.0em" 
          borderstyle="Solid" 
          borderwidth="1px" 
          bordercolor="#507CD1" 
          backcolor="White" />
        <HeaderStyle forecolor="White" 
          horizontalalign="Center" 
          font-size="0.9em" 
          font-bold="True"
          backcolor="#284E98" 
          borderstyle="Solid" 
          bordercolor="#EFF3FB" 
          borderwidth="2px" />
        <SideBarStyle verticalalign="Top" 
          horizontalalign="Center"
          font-size="0.8em" 
          forecolor="#000099"
          backcolor="#EFF3FB"
          width="45px" />
        <HeaderTemplate>
          <b>Wizard Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="WizardClass.vb" Inherits="WizardClassvb_aspx" %>

<!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>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">    
      <asp:Wizard id="Wizard1" 
        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">       
      <StepStyle forecolor="#333333" 
        font-size="0.8em" />
        <WizardSteps>        
          <asp:WizardStep id="Step1" 
            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.
          </asp:WizardStep>          
          <asp:WizardStep id="Step2"
            title="Two" 
            runat="server" >
            <!-- ... Put UI elements here ... -->
            Please enter your billing information.
            <br />
            Name:<br />
            <asp:TextBox runat="server" 
              id="BillingName" 
              width="226px" 
              height="17px" /> 
            <br />
            Email Address:<br />
            <asp:TextBox runat="server" 
              id="EmailAddress" 
              width="224px" 
              height="17px" />
            <br />
            Address Line 1: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine1" 
              width="314px" 
              height="17px" />
            <br />
            Address Line 2: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine2" 
              width="314px" 
              height="17px" />
            <br />
            City: <br />
            <asp:TextBox runat="server" 
              id="BillingCity" 
              width="155px" 
              height="17px" /> 
            <br />
            State: <br />
            <asp:TextBox runat="server" 
              id="BillingState" 
              width="75px" 
              height="17px" /> 
            <br />
            ZIP Code: <br />
            <asp:TextBox runat="server" 
              id="BillingZip" 
              height="17px" />
            <br /><br />
            <asp:CheckBox runat="server" 
              id="SeparateShippingCheckBox" 
              text="Please check here if you would like to add a separate shipping address." />
          </asp:WizardStep>          
          <asp:WizardStep id="Step3" 
            title="Three"
            runat="server" >
            <!-- Gather the shipping address in this step if CheckBox1 was selected. -->
            Please enter your shipping information.
            <br />
                Name:<br />
                <asp:TextBox runat="server" 
                  id="ShippingName" 
                  height="17px" /> 
                <br />
                Address Line 1: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress1" 
                  width="370px" 
                  height="17px" />
                <br />
                Address Line 2: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress2" 
                  width="370px" 
                  height="17px" />
                <br />
                City: <br />
                <asp:TextBox runat="server" 
                  id="ShippingCity" 
                  height="17px" /> 
                <br />
                State: <br />
                <asp:TextBox runat="server" 
                  id="ShippingState" 
                  width="65px" 
                  height="17px" />
                <br /> 
                ZIP Code: <br />
                <asp:TextBox runat="server" 
                  id="ShippingZip" 
                  height="17px" />
          </asp:WizardStep>
          <asp:WizardStep id="Finish" 
            title="Finish"
            runat="server" >
            <!-- Put UI elements here for the Finish step. -->
            <asp:Button runat="server" 
              id="GoBackButton" 
              text="Go Back to Step 2" 
              forecolor="#284E98" 
              font-names="Verdana"
              font-size="1.0em" 
              borderstyle="Solid" 
              borderwidth="1px" 
              bordercolor="#507CD1" 
              backcolor="White" /> 
          </asp:WizardStep>          
          <asp:WizardStep runat="server" 
            steptype="Complete" 
            title="Complete" 
            id="Complete">
            <asp:Label runat="server" 
              id="CompleteMessageLabel" 
              width="408px" 
              height="24px">
            </asp:Label>
          </asp:WizardStep>
        </WizardSteps> 
        <NavigationButtonStyle forecolor="#284E98" 
          font-names="Verdana"
          font-size="1.0em" 
          borderstyle="Solid" 
          borderwidth="1px" 
          bordercolor="#507CD1" 
          backcolor="White" />
        <HeaderStyle forecolor="White" 
          horizontalalign="Center" 
          font-size="0.9em" 
          font-bold="True"
          backcolor="#284E98" 
          borderstyle="Solid" 
          bordercolor="#EFF3FB" 
          borderwidth="2px" />
        <SideBarStyle verticalalign="Top" 
          horizontalalign="Center"
          font-size="0.8em" 
          forecolor="#000099"
          backcolor="#EFF3FB"
          width="45px" />
        <HeaderTemplate>
          <b>Wizard Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>

下面的代码示例是在前面的示例中使用的网页的代码隐藏文件。The following code example is the code-behind file for the Web page used in the preceding example.

using System;
using System.Data;
using System.Configuration;
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 WizardClasscs_aspx : System.Web.UI.Page
{
    protected void OnFinishButtonClick(Object sender, WizardNavigationEventArgs e)
    {
        // The OnFinishButtonClick method is a good place to collect all
        // the data from the completed pages and persist it to the data store. 

        // For this example, write a confirmation message to the Complete page
        // of the Wizard control.
        Label tempLabel = (Label)Wizard1.FindControl("CompleteMessageLabel");
        if (tempLabel != null)
        {
            tempLabel.Text = "Your order has been placed. An email confirmation will be sent to "
            + (EmailAddress.Text.Length == 0 ? "your email address" : EmailAddress.Text) + ".";
        }
    }

    protected void OnGoBackButtonClick(object sender, EventArgs e)
    {
        // The GoBackButtonClick event is raised when the GoBackButton
        // is clicked on the Finish page of the Wizard.  

        // Check the value of Step1's AllowReturn property.
        if (Step1.AllowReturn)
        {
            // Return to Step1.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.Step1);
        }
        else
        {
            // Step1 is not a valid step to return to; go to Step2 instead.
            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 the ActiveStep is changing to Step3, check to see whether the 
        // SeparateShippingCheckBox is selected.  If it is not, skip to the
        // Finish step.
        if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.Step3))
        {
            if (this.SeparateShippingCheckBox.Checked)
            {
                Wizard1.MoveTo(this.Step3);
            }
            else
            {
                Wizard1.MoveTo(this.Finish);
            }
        }
    }
}
Partial Class WizardClassvb_aspx
    Inherits System.Web.UI.Page

   Protected Sub OnFinishButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick

        ' The OnFinishButtonClick method is a good place to collect all
        ' the data from the completed pages and persist it to the data store. 

        ' For this example, write a confirmation message to the Complete page
        ' of the Wizard control.
        Dim tempLabel As Label = CType(Wizard1.FindControl("CompleteMessageLabel"), Label)
        If Not tempLabel Is Nothing Then

            Dim tempEmailAddress As String = "your email address"
            If EmailAddress.Text.Length <> 0 Then
                tempEmailAddress = EmailAddress.Text
            End If

            tempLabel.Text = "Your order has been placed. An email confirmation will be sent to " & _
                tempEmailAddress & "."

        End If
    End Sub

    Protected Sub OnGoBackButtonClick(ByVal sender As Object, ByVal e As EventArgs) Handles GoBackButton.Click

        ' The GoBackButtonClick event is raised when the GoBackButton
        ' is clicked on the Finish page of the Wizard.  

        ' Check the value of Step1's AllowReturn property.
        If Step1.AllowReturn Then
            ' Return to Step1.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step1)
        Else
            ' Step1 is not a valid step to return to; go to Step2 instead.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step2)
            Response.Write("ActiveStep is set to Step2 because Step1 has AllowReturn set to false.")
        End If
    End Sub

    Protected Sub OnActiveStepChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Wizard1.ActiveStepChanged

        ' If the ActiveStep is changing to Step3, check to see whether the 
        ' SeparateShippingCheckBox is selected.  If it is not, skip to the
        ' Finish step.

        If (Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step3)) Then

            If (Me.SeparateShippingCheckBox.Checked) Then
                Wizard1.MoveTo(Me.Step3)
            Else
                Wizard1.MoveTo(Me.Finish)
            End If

        End If
    End Sub

End Class

注解

本主题内容:In this topic:

介绍Introduction

您可以使用 Wizard 控件来执行以下操作:You can use the Wizard control to:

  • 跨多个步骤收集相关数据。Collect related data across multiple steps.

  • 分解一个更大的网页,用于将用户输入收集到较小的逻辑步骤。Break up a larger Web page used to collect user input into smaller logical steps.

  • 允许线性或非线性导航完成这些步骤。Allow for either linear or nonlinear navigation through the steps.

向导组件Wizard Components

Wizard 控件由以下组件组成:The Wizard control is made up of the following components:

  • WizardStepCollection 系列步骤,其中包含由页面开发人员定义的每个步骤的用户界面。A WizardStepCollection collection of steps that contain the user interface for each step, as defined by the page developer.

  • 内置导航功能,用于根据值确定要显示的相应按钮 StepTypeBuilt-in navigation capabilities that determine the appropriate buttons to display based on the StepType value.

  • 一种标题区域,可对其进行自定义以显示特定于用户当前所处步骤的信息。A header area that can be customized to display information specific to the step that the user is currently on.

  • 边栏区域,可用于快速导航到控件中的步骤。A sidebar area that can be used to quickly navigate to steps in the control.

    备注

    如果使用 Microsoft Visual Studio 2005,请注意, ActiveStepIndex 将保留在源视图中。If you are using Microsoft Visual Studio 2005, note that the ActiveStepIndex is persisted in Source view. 如果在 WizardSteps 设计视图中通过单击侧栏按钮来更改属性,然后运行页面,则 Wizard 可能不会显示控件的第一步,因为 ActiveStepIndex 可能会指向不同的步骤。If you change the WizardSteps property in Design view by clicking the sidebar buttons, and you then run the page, the first step of the Wizard control might not be shown because the ActiveStepIndex might be pointing to a different step.

向导步骤Wizard Steps

控件中的每个步骤 Wizard 都有一个 StepType 属性,该属性确定该步骤具有的导航功能的类型。Each of the steps in the Wizard control has a StepType property that determines the kind of navigation functionality that the step has. 如果没有为属性指定值 StepType ,则默认值为 AutoIf you do not specify a value for the StepType property, the default value is Auto. 下表列出了属性的可用设置 StepType 和步骤的结果行为。The following table lists the available settings for the StepType property and the resulting behavior of the step.

WizardStepType.Auto 为步骤呈现的导航 UI 由声明该步骤的顺序确定。WizardStepType.Auto The navigation UI that is rendered for the step is determined by the order in which the step is declared.

WizardStepType.Complete 该步骤是要显示的最后一个步骤。WizardStepType.Complete The step is the last one to appear. 不呈现任何导航按钮。No navigation buttons are rendered.

WizardStepType.Finish 步骤是收集用户数据的最后一个步骤。WizardStepType.Finish The step is the last one that collects user data. 为导航呈现 " 完成 " 按钮。The Finish button is rendered for navigation.

WizardStepType.Start 该步骤是要显示的第一个步骤。WizardStepType.Start The step is the first one to appear. 不呈现 " 上一步 " 按钮。A Previous button is not rendered.

WizardStepType.Step 步骤是第一个和最后一个步骤之间的任何步骤。WizardStepType.Step The step is any step between the first and last. 呈现用于导航的“上一步”和“下一步”按钮。Previous and Next buttons are rendered for navigation.

收集向导数据Collecting Wizard Data

使用 Wizard 控件,可以通过线性或非线性导航来收集数据。Using the Wizard control, data can be collected through linear or nonlinear navigation. 非线性导航的一些示例是跳过不必要的步骤,或返回到之前完成的步骤来更改某个值。Some examples of nonlinear navigation are skipping unnecessary steps or returning to a previously completed step to change some value. Wizard控件在各个步骤之间维护其状态,因此在步骤中输入的数据无需保存到数据存储区,直到完成控件的所有步骤 WizardThe Wizard control maintains its state between steps, so the data entered on a step does not need to be persisted to a data store until all the steps of the Wizard control have been completed.

或者,如果要在每个步骤完成时将收集的数据保存到数据存储区(如引发事件时), NextButtonClick 则应将 AllowReturn 对象的属性设置为, WizardStepBase false 以使用户无法返回到以前完成的步骤,并在提交数据后对其进行更改。Alternatively, if you want to persist the collected data to a data store as each step is completed, such as when the NextButtonClick event is raised, you should set the AllowReturn property of the WizardStepBase object to false so that the user cannot return to a previously completed step and change the data once it has been submitted.

向导命令名称Wizard Command Names

Wizard控件继承类和类中的以下命令名称 View MultiViewNextViewCommandNamePreviousViewCommandNameSwitchViewByIDCommandNameSwitchViewByIndexCommandNameThe Wizard control inherits the following command names from the View class and MultiView class: NextViewCommandName, PreviousViewCommandName, SwitchViewByIDCommandName, and SwitchViewByIndexCommandName. 向导控件忽略这些命令名称,并且不包含任何特殊逻辑来使这些命令自动用于导航。The Wizard control ignores these command names and does not include any special logic to enable these commands to automatically work for navigation. 如果从控件中的按钮删除或缺少命令名称 Wizard ,则不会引发异常。If a command name is removed or is missing from a button in the Wizard control, no exception is thrown. 例如,如果 StartNavigationTemplate 按钮缺少的值 CommandName ,则不会引发异常。For example, if the StartNavigationTemplate button is missing a value for CommandName, no exception is thrown.

动态更改步骤Dynamically Changing Steps

您可以使用 MoveTo 方法或 ActiveStepIndex 属性动态更改当前显示在控件中的步骤 WizardYou can use the MoveTo method or the ActiveStepIndex property to dynamically change the step that is currently displayed in the Wizard control.

备注

如果以编程方式 WizardStepPage_Load 事件处理程序中添加,则必须在加载页面之前将导航添加到该步骤。If you programmatically add a WizardStep in the Page_Load event handler, you must add the navigation to that step prior to the page loading.

向导外观Wizard Appearance

控件的外观可 Wizard 通过模板、外观和样式设置完全自定义。The appearance of the Wizard control is fully customizable through templates, skins, and style settings. 例如,您可以使用 HeaderTemplateSideBarTemplateStartNavigationTemplateFinishNavigationTemplateStepNavigationTemplate 属性来自定义控件的接口 WizardFor example, you can use the HeaderTemplate, SideBarTemplate, StartNavigationTemplate, FinishNavigationTemplate, and StepNavigationTemplate properties to customize the interface of the Wizard control.

备注

设置 FinishNavigationTemplate 、、 DisplaySideBarHeaderTemplate SideBarTemplate 、或属性将重新 StartNavigationTemplate StepNavigationTemplate 创建控件的子控件 WizardSetting the FinishNavigationTemplate, DisplaySideBar, HeaderTemplate, SideBarTemplate, StartNavigationTemplate, or StepNavigationTemplate property recreates the child controls of the Wizard control. 因此,子控件的视图状态会在进程中丢失。As a result, the view state for the child controls is lost in the process. 若要避免这种情况,请显式保持 Wizard 控件的子控件的控件状态,或避免在模板内放置控件。To avoid this situation, explicitly maintain the control state of the Wizard control's child controls explicitly, or avoid putting controls inside of templates.

请注意, Wizard 对于非标准或兼容模式,控件不支持特殊的 Microsoft Internet Explorer 呈现。Note that the Wizard control does not support special Microsoft Internet Explorer rendering for non-standard or quirks mode. 若要使用控件获得最佳的 Internet Explorer 呈现 Wizard 功能,请使用 XHTML 文档类型,该类型默认情况下会在 Visual Web Developer 和 Visual Studio 中添加。To get the best Internet Explorer rendering using the Wizard control, use the XHTML doc type, which is added by default in Visual Web Developer and Visual Studio.

使用布局模板设置格式Formatting Using Layout Templates

Wizard控件使你可以指定控件的布局,而无需使用 HTML table 元素。The Wizard control lets you specify the layout of the control without requiring you to use an HTML table element. 相反,可以使用 LayoutTemplate 元素来指定布局。Instead, you can use a LayoutTemplate element to specify the layout. 在模板中,创建占位符控件以指示应将项动态插入控件的位置。In the template, you create placeholder controls to indicate where items should be dynamically inserted into the control. (这类似于控件的模板模型的工作方式 ListView 。 ) 有关详细信息,请参见 Wizard.LayoutTemplate 属性。(This is similar to how the template model for the ListView control works.) For more information, see the Wizard.LayoutTemplate property.

可访问性Accessibility

有关如何配置此控件以生成符合辅助功能标准的标记的信息,请参阅 Visual Studio 中的辅助功能和 ASP.NETASP.NET 控件和辅助功能For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

声明性语法Declarative Syntax

<asp:Wizard
    AccessKey="string"
    ActiveStepIndex="integer"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
        Inset|Outset"
    BorderWidth="size"
    CancelButtonImageUrl="uri"
    CancelButtonText="string"
    CancelButtonType="Button|Image|Link"
    CancelDestinationPageUrl="uri"
    CellPadding="integer"
    CellSpacing="integer"
    CssClass="string"
    DisplayCancelButton="True|False"
    DisplaySideBar="True|False"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FinishCompleteButtonImageUrl="uri"
    FinishCompleteButtonText="string"
    FinishCompleteButtonType="Button|Image|Link"
    FinishDestinationPageUrl="uri"
    FinishPreviousButtonImageUrl="uri"
    FinishPreviousButtonText="string"
    FinishPreviousButtonType="Button|Image|Link"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
        Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    HeaderText="string"
    Height="size"
    ID="string"
    OnActiveStepChanged="ActiveStepChanged event handler"
    OnCancelButtonClick="CancelButtonClick event handler"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnFinishButtonClick="FinishButtonClick event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnNextButtonClick="NextButtonClick event handler"
    OnPreRender="PreRender event handler"
    OnPreviousButtonClick="PreviousButtonClick event handler"
    OnSideBarButtonClick="SideBarButtonClick event handler"
    OnUnload="Unload event handler"
    runat="server"
    SkinID="string"
    SkipLinkText="string"
    StartNextButtonImageUrl="uri"
    StartNextButtonText="string"
    StartNextButtonType="Button|Image|Link"
    StepNextButtonImageUrl="uri"
    StepNextButtonText="string"
    StepNextButtonType="Button|Image|Link"
    StepPreviousButtonImageUrl="uri"
    StepPreviousButtonText="string"
    StepPreviousButtonType="Button|Image|Link"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    Visible="True|False"
    Width="size"
>
        <CancelButtonStyle />
        <FinishCompleteButtonStyle />
        <FinishNavigationTemplate>
            <!-- child controls -->
        </FinishNavigationTemplate>
        <FinishPreviousButtonStyle />
        <HeaderStyle />
        <HeaderTemplate>
            <!-- child controls -->
        </HeaderTemplate>
        <NavigationButtonStyle />
        <NavigationStyle />
        <SideBarButtonStyle />
        <SideBarStyle />
        <SideBarTemplate>
            <!-- child controls -->
        </SideBarTemplate>
        <StartNavigationTemplate>
            <!-- child controls -->
        </StartNavigationTemplate>
        <StartNextButtonStyle />
        <StepNavigationTemplate>
            <!-- child controls -->
        </StepNavigationTemplate>
        <StepNextButtonStyle />
        <StepPreviousButtonStyle />
        <StepStyle />
        <WizardSteps>
                <asp:TemplatedWizardStep
                    AllowReturn="True|False"
                    ContentTemplateContainer="string"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
>
                        <ContentTemplate>
                            <!-- child controls -->
                        </ContentTemplate>
                        <CustomNavigationTemplate>
                            <!-- child controls -->
                        </CustomNavigationTemplate>
                </asp:TemplatedWizardStep>
                <asp:WizardStep
                    AllowReturn="True|False"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
                />
        </WizardSteps>
</asp:Wizard>

构造函数

Wizard()

初始化 Wizard 类的新实例。Initializes a new instance of the Wizard class.

字段

CancelButtonID

指定“取消”按钮的标识符。Specifies the identifier for the Cancel button. 此字段是静态的且是只读的。This field is static and read-only.

CancelCommandName

检索“取消”按钮的命令名。Retrieves the command name for the Cancel button. 此字段是静态的且是只读的。This field is static and read-only.

CustomFinishButtonID

检索自定义的“完成”按钮的标识符。Retrieves the identifier for a custom Finish button. 此字段是静态的且是只读的。This field is static and read-only.

CustomNextButtonID

检索自定义的“下一步”按钮的标识符。Retrieves the identifier for a custom Next button. 此字段是静态的且是只读的。This field is static and read-only.

CustomPreviousButtonID

检索自定义的“上一步”按钮的标识符。Retrieves the identifier for a custom Previous button. 此字段是静态的且是只读的。This field is static and read-only.

DataListID

检索侧栏 DataList 集合的标识符。Retrieves the identifier for the sidebar DataList collection. 此字段是静态的且是只读的。This field is static and read-only.

FinishButtonID

检索“完成”按钮的标识符。Retrieves the identifier for the Finish button. 此字段是静态的且是只读的。This field is static and read-only.

FinishPreviousButtonID

检索 Finish 步骤中的“上一步”按钮的标识符。Retrieves the identifier for the Previous button on the Finish step. 此字段是静态的且是只读的。This field is static and read-only.

HeaderPlaceholderId

获取 HeaderTemplate 控件中 Wizard 占位符的 ID。Gets the ID of the HeaderTemplate placeholder in a Wizard control.

MoveCompleteCommandName

检索与“完成”按钮关联的命令名。Retrieves the command name that is associated with the Finish button. 此字段是静态的且是只读的。This field is static and read-only.

MoveNextCommandName

检索与“下一步”按钮关联的命令名。Retrieves the command name that is associated with the Next button. 此字段是静态的且是只读的。This field is static and read-only.

MovePreviousCommandName

检索与“上一步”按钮关联的命令名。Retrieves the command name that is associated with the Previous button. 此字段是静态的且是只读的。This field is static and read-only.

MoveToCommandName

检索与每个侧栏按钮关联的命令名。Retrieves the command name that is associated with each of the sidebar buttons. 此字段是静态的且是只读的。This field is static and read-only.

NavigationPlaceholderId

获取 StartNavigationTemplate 控件中 Wizard 占位符的 ID。Gets the ID of the StartNavigationTemplate placeholder in a Wizard control.

SideBarButtonID

检索与每个侧栏按钮关联的标识符。Retrieves the identifier that is associated with each of the sidebar buttons. 此字段是静态的且是只读的。This field is static and read-only.

SideBarPlaceholderId

获取 SideBarTemplate 控件中 Wizard 占位符的 ID。Gets the ID of the SideBarTemplate placeholder in a Wizard control.

StartNextButtonID

检索与 Start 步骤中的“下一步”按钮关联的标识符。Retrieves the identifier that is associated with the Next button on the Start step. 此字段是静态的且是只读的。This field is static and read-only.

StepNextButtonID

检索与“下一步”按钮关联的标识符。Retrieves the identifier that is associated with the Next button. 此字段是静态的且是只读的。This field is static and read-only.

StepPreviousButtonID

检索与“上一步”按钮关联的标识符。Retrieves the identifier that is associated with the Previous button. 此字段是静态的且是只读的。This field is static and read-only.

WizardStepPlaceholderId

获取 WizardStep 控件中 Wizard 占位符的 ID。Gets the ID of the WizardStep placeholder in a Wizard control.

属性

AccessKey

获取或设置使您得以快速导航到 Web 服务器控件的访问键。Gets or sets the access key that allows you to quickly navigate to the Web server control.

(继承自 WebControl)
ActiveStep

获取 WizardSteps 集合中当前显示给用户的步骤。Gets the step in the WizardSteps collection that is currently displayed to the user.

ActiveStepIndex

获取或设置当前 WizardStepBase 对象的索引。Gets or sets the index of the current WizardStepBase object.

Adapter

获取控件的浏览器特定适配器。Gets the browser-specific adapter for the control.

(继承自 Control)
AppRelativeTemplateSourceDirectory

获取或设置包含该控件的 PageUserControl 对象的应用程序相对虚拟目录。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(继承自 Control)
Attributes

获取与控件的特性不对应的任意特性(只用于呈现)的集合。Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

(继承自 WebControl)
BackColor

获取或设置 Web 服务器控件的背景色。Gets or sets the background color of the Web server control.

(继承自 WebControl)
BindingContainer

获取包含该控件的数据绑定的控件。Gets the control that contains this control's data binding.

(继承自 Control)
BorderColor

获取或设置 Web 控件的边框颜色。Gets or sets the border color of the Web control.

(继承自 WebControl)
BorderStyle

获取或设置 Web 服务器控件的边框样式。Gets or sets the border style of the Web server control.

(继承自 WebControl)
BorderWidth

获取或设置 Web 服务器控件的边框宽度。Gets or sets the border width of the Web server control.

(继承自 WebControl)
CancelButtonImageUrl

获取或设置为“取消”按钮显示的图像的 URL。Gets or sets the URL of the image displayed for the Cancel button.

CancelButtonStyle

获取对定义“取消”按钮外观的样式属性集合的引用。Gets a reference to a collection of style properties that define the appearance of the Cancel button.

CancelButtonText

获取或设置为“取消”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Cancel button.

CancelButtonType

获取或设置呈现为“取消”按钮的按钮类型。Gets or sets the type of button that is rendered as the Cancel button.

CancelDestinationPageUrl

获取或设置在用户单击“取消”按钮时将定向到的 URL。Gets or sets the URL that the user is directed to when they click the Cancel button.

CellPadding

获取或设置单元格内容和单元格边框之间的空间量。Gets or sets the amount of space between the contents of the cell and the cell border.

CellSpacing

获取或设置单元格间的空间量。Gets or sets the amount of space between cells.

ChildControlsCreated

获取一个值,该值指示是否已创建服务器控件的子控件。Gets a value that indicates whether the server control's child controls have been created.

(继承自 Control)
ClientID

获取由 ASP.NET 生成的 HTML 标记的控件 ID。Gets the control ID for HTML markup that is generated by ASP.NET.

(继承自 Control)
ClientIDMode

获取或设置用于生成 ClientID 属性值的算法。Gets or sets the algorithm that is used to generate the value of the ClientID property.

(继承自 Control)
ClientIDSeparator

获取一个字符值,该值表示 ClientID 属性中使用的分隔符字符。Gets a character value representing the separator character used in the ClientID property.

(继承自 Control)
Context

为当前 Web 请求获取与服务器控件关联的 HttpContext 对象。Gets the HttpContext object associated with the server control for the current Web request.

(继承自 Control)
Controls

获取表示 ControlCollection 中的子控件的 CompositeControl 对象。Gets a ControlCollection object that represents the child controls in a CompositeControl.

(继承自 CompositeControl)
ControlStyle

获取 Web 服务器控件的样式。Gets the style of the Web server control. 此属性主要由控件开发人员使用。This property is used primarily by control developers.

(继承自 WebControl)
ControlStyleCreated

获取一个值,该值指示是否已为 Style 属性创建了 ControlStyle 对象。Gets a value indicating whether a Style object has been created for the ControlStyle property. 此属性主要由控件开发人员使用。This property is primarily used by control developers.

(继承自 WebControl)
CssClass

获取或设置由 Web 服务器控件在客户端呈现的级联样式表 (CSS) 类。Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

(继承自 WebControl)
DataItemContainer

如果命名容器实现 IDataItemContainer,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataItemContainer.

(继承自 Control)
DataKeysContainer

如果命名容器实现 IDataKeysControl,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataKeysControl.

(继承自 Control)
DesignMode

获取一个值,该值指示是否正在使用设计图面上的一个控件。Gets a value indicating whether a control is being used on a design surface.

(继承自 Control)
DisplayCancelButton

获取或设置一个布尔值,指示是否显示“取消”按钮。Gets or sets a Boolean value indicating whether to display a Cancel button.

DisplaySideBar

获取或设置一个布尔值,该值指示是否显示 Wizard 控件上的侧栏区域。Gets or sets a Boolean value indicating whether to display the sidebar area on the Wizard control.

Enabled

获取或设置一个值,该值指示是否启用 Web 服务器控件。Gets or sets a value indicating whether the Web server control is enabled.

(继承自 WebControl)
EnableTheming

获取或设置一个值,该值指示主题是否应用于该控件。Gets or sets a value indicating whether themes apply to this control.

(继承自 WebControl)
EnableViewState

获取或设置一个值,该值指示服务器控件是否向发出请求的客户端保持自己的视图状态以及它所包含的任何子控件的视图状态。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(继承自 Control)
Events

获取控件的事件处理程序委托列表。Gets a list of event handler delegates for the control. 此属性是只读的。This property is read-only.

(继承自 Control)
FinishCompleteButtonImageUrl

获取或设置为“完成”按钮显示的图像的 URL。Gets or sets the URL of the image that is displayed for the Finish button.

FinishCompleteButtonStyle

获取一个对 Style 对象的引用,该对象定义“完成”按钮的设置。Gets a reference to a Style object that defines the settings for the Finish button.

FinishCompleteButtonText

获取或设置为“完成”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Finish button.

FinishCompleteButtonType

获取或设置呈现为“完成”按钮的按钮类型。Gets or sets the type of button that is rendered as the Finish button.

FinishDestinationPageUrl

获取或设置在用户单击“完成”按钮时将重定向到的 URL。Gets or sets the URL that the user is redirected to when they click the Finish button.

FinishNavigationTemplate

获取或设置在 Finish 步骤中用于显示导航区域的模板。Gets or sets the template that is used to display the navigation area on the Finish step.

FinishPreviousButtonImageUrl

获取或设置为 Finish 步骤中的“上一步”按钮显示的图像的 URL。Gets or sets the URL of the image that is displayed for the Previous button on the Finish step.

FinishPreviousButtonStyle

获取一个对 Style 对象的引用,该对象定义 Finish 步骤中“上一步”按钮的设置。Gets a reference to a Style object that defines the settings for the Previous button on the Finish step.

FinishPreviousButtonText

获取或设置为 Finish 步骤中的“上一步”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Previous button on the Finish step.

FinishPreviousButtonType

获取或设置呈现为 Finish 步骤中的“上一步”按钮的按钮类型。Gets or sets the type of button that is rendered as the Previous button on the Finish step.

Font

获取与 Web 服务器控件关联的字体属性。Gets the font properties associated with the Web server control.

(继承自 WebControl)
ForeColor

获取或设置 Web 服务器控件的前景色(通常是文本颜色)。Gets or sets the foreground color (typically the color of the text) of the Web server control.

(继承自 WebControl)
HasAttributes

获取一个值,该值指示控件是否具有特性集。Gets a value indicating whether the control has attributes set.

(继承自 WebControl)
HasChildViewState

获取一个值,该值指示当前服务器控件的子控件是否具有任何已保存的视图状态设置。Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(继承自 Control)
HeaderStyle

获取一个对 Style 对象的引用,该对象定义控件上标题区域的设置。Gets a reference to a Style object that defines the settings for the header area on the control.

HeaderTemplate

获取或设置用于显示控件上标题区域的模板。Gets or sets the template that is used to display the header area on the control.

HeaderText

获取或设置为在控件上的标题区域显示的文本标题。Gets or sets the text caption that is displayed for the header area on the control.

Height

获取或设置 Web 服务器控件的高度。Gets or sets the height of the Web server control.

(继承自 WebControl)
ID

获取或设置分配给服务器控件的编程标识符。Gets or sets the programmatic identifier assigned to the server control.

(继承自 Control)
IdSeparator

获取用于分隔控件标识符的字符。Gets the character used to separate control identifiers.

(继承自 Control)
IsChildControlStateCleared

获取一个值,该值指示该控件中包含的控件是否具有控件状态。Gets a value indicating whether controls contained within this control have control state.

(继承自 Control)
IsEnabled

获取一个值,该值指示是否启用控件。Gets a value indicating whether the control is enabled.

(继承自 WebControl)
IsTrackingViewState

获取一个值,用于指示服务器控件是否会将更改保存到其视图状态中。Gets a value that indicates whether the server control is saving changes to its view state.

(继承自 Control)
IsViewStateEnabled

获取一个值,该值指示是否为该控件启用了视图状态。Gets a value indicating whether view state is enabled for this control.

(继承自 Control)
LayoutTemplate

获取或设置 Wizard 控件中的根容器的自定义内容。Gets or sets the custom content of the root container in a Wizard control.

LoadViewStateByID

获取一个值,该值指示控件是否通过 ID 而不是索引参与加载其视图状态。Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(继承自 Control)
NamingContainer

获取对服务器控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 ID 属性值的服务器控件。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(继承自 Control)
NavigationButtonStyle

获取一个对 Style 对象的引用,该对象定义控件上导航区域中按钮的设置。Gets a reference to a Style object that defines the settings for the buttons in the navigation area on the control.

NavigationStyle

获取一个对 Style 对象的引用,该对象定义控件上导航区域的设置。Gets a reference to a Style object that defines the settings for the navigation area on the control.

Page

获取对包含服务器控件的 Page 实例的引用。Gets a reference to the Page instance that contains the server control.

(继承自 Control)
Parent

获取对页 UI 层次结构中服务器控件的父控件的引用。Gets a reference to the server control's parent control in the page control hierarchy.

(继承自 Control)
RenderingCompatibility

获取一个值,该值指定呈现的 HTML 将与之兼容的 ASP.NET 版本。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(继承自 Control)
SideBarButtonStyle

获取一个对 Style 对象的引用,该对象定义侧栏上按钮的设置。Gets a reference to a Style object that defines the settings for the buttons on the sidebar.

SideBarStyle

获取一个对 Style 对象的引用,该对象定义控件上侧栏区域的设置。Gets a reference to a Style object that defines the settings for the sidebar area on the control.

SideBarTemplate

获取或设置用于显示控件上侧栏区域的模板。Gets or sets the template that is used to display the sidebar area on the control.

Site

获取容器信息,该容器在呈现于设计图面上时承载当前控件。Gets information about the container that hosts the current control when rendered on a design surface.

(继承自 Control)
SkinID

获取或设置要应用于控件的外观。Gets or sets the skin to apply to the control.

(继承自 WebControl)
SkipLinkText

获取或设置一个值,它用于呈现替换文本,以通知屏幕阅读器跳过侧栏区域中的内容。Gets or sets a value that is used to render alternate text that notifies screen readers to skip the content in the sidebar area.

StartNavigationTemplate

获取或设置用于显示 Start 控件的 Wizard 步骤中的导航区域的模板。Gets or sets the template that is used to display the navigation area on the Start step of the Wizard control.

StartNextButtonImageUrl

获取或设置为 Start 步骤中的“下一步”按钮显示的图像的 URL。Gets or sets the URL of the image that is displayed for the Next button on the Start step.

StartNextButtonStyle

获取一个对 Style 的引用,该对象定义 Start 步骤中的“下一步”按钮的设置。Gets a reference to a Style object that defines the settings for the Next button on the Start step.

StartNextButtonText

获取或设置为 Start 步骤中的“下一步”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Next button on the Start step.

StartNextButtonType

获取或设置呈现为 Start 步骤中的“下一步”按钮的按钮类型。Gets or sets the type of button that is rendered as the Next button on the Start step.

StepNavigationTemplate

获取或设置模板,该模板用于显示除 WizardStepBaseStartFinish 步骤以外的任何从 Complete 派生的对象上的导航区域。Gets or sets the template that is used to display the navigation area on any WizardStepBase-derived objects other than the Start, the Finish, or Complete step.

StepNextButtonImageUrl

获取或设置为“下一步”按钮显示的图像的 URL。Gets or sets the URL of the image that is displayed for the Next button.

StepNextButtonStyle

获取一个对 Style 对象的引用,该对象定义“下一步”按钮的设置。Gets a reference to the Style object that defines the settings for the Next button.

StepNextButtonText

获取或设置为“下一步”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Next button.

StepNextButtonType

获取或设置呈现为“下一步”按钮的按钮类型。Gets or sets the type of button that is rendered as the Next button.

StepPreviousButtonImageUrl

获取或设置为“上一步”按钮显示的图像的 URL。Gets or sets the URL of the image that is displayed for the Previous button.

StepPreviousButtonStyle

获取一个对 Style 对象的引用,该对象定义“上一步”按钮的设置。Gets a reference to a Style object that defines the settings for the Previous button.

StepPreviousButtonText

获取或设置为“上一步”按钮显示的描述文字。Gets or sets the text caption that is displayed for the Previous button.

StepPreviousButtonType

获取或设置呈现为“上一步”按钮的按钮类型。Gets or sets the type of button that is rendered as the Previous button.

StepStyle

获取一个对 Style 对象的引用,该对象定义 WizardStep 对象的设置。Gets a reference to a Style object that defines the settings for the WizardStep objects.

Style

获取将在 Web 服务器控件的外部标记上呈现为样式特性的文本特性的集合。Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

(继承自 WebControl)
SupportsDisabledAttribute

获取一个值,该值指示在控件的 disabled 属性为 IsEnabled 时,控件是否应将呈现的 HTML 元素的 false 特性设置为 "disabled"。Gets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false.

(继承自 CompositeControl)
TabIndex

获取或设置 Web 服务器控件的选项卡索引。Gets or sets the tab index of the Web server control.

(继承自 WebControl)
TagKey

获取与 HtmlTextWriterTag 控件相对应的 Wizard 值。Gets the HtmlTextWriterTag value that corresponds to the Wizard control.

TagName

获取控件标记的名称。Gets the name of the control tag. 此属性主要由控件开发人员使用。This property is used primarily by control developers.

(继承自 WebControl)
TemplateControl

获取或设置对包含该控件的模板的引用。Gets or sets a reference to the template that contains this control.

(继承自 Control)
TemplateSourceDirectory

获取包含当前服务器控件的 PageUserControl 的虚拟目录。Gets the virtual directory of the Page or UserControl that contains the current server control.

(继承自 Control)
ToolTip

获取或设置当鼠标指针悬停在 Web 服务器控件上时显示的文本。Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

(继承自 WebControl)
UniqueID

获取服务器控件的唯一的、以分层形式限定的标识符。Gets the unique, hierarchically qualified identifier for the server control.

(继承自 Control)
ValidateRequestMode

获取或设置指示控件是否检查来自浏览器的客户端输入是否具有潜在危险值的值。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(继承自 Control)
ViewState

获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原服务器控件的视图状态。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(继承自 Control)
ViewStateIgnoresCase

获取一个值,该值指示 StateBag 对象是否不区分大小写。Gets a value that indicates whether the StateBag object is case-insensitive.

(继承自 Control)
ViewStateMode

获取或设置此控件的视图状态模式。Gets or sets the view-state mode of this control.

(继承自 Control)
Visible

获取或设置一个值,该值指示服务器控件是否作为 UI 呈现在页上。Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(继承自 Control)
Width

获取或设置 Web 服务器控件的宽度。Gets or sets the width of the Web server control.

(继承自 WebControl)
WizardSteps

获取一个包含为该控件定义的所有 WizardStepBase 对象的集合。Gets a collection containing all the WizardStepBase objects that are defined for the control.

方法

AddAttributesToRender(HtmlTextWriter)

将需要呈现的 HTML 特性和样式添加到指定的 HtmlTextWriterTag 中。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
AddedControl(Control, Int32)

在子控件添加到 Control 对象的 Controls 集合后调用。Called after a child control is added to the Controls collection of the Control object.

(继承自 Control)
AddParsedSubObject(Object)

通知服务器控件,分析了一个元素(XML 或 HTML),并将该元素添加到服务器控件的 ControlCollection 对象中。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(继承自 Control)
AllowNavigationToStep(Int32)

使用一个布尔值来确定 ActiveStep 属性是否可以设置为与传入的索引对应的 WizardStepBase 对象。Uses a Boolean value to determine whether the ActiveStep property can be set to the WizardStepBase object that corresponds to the index that is passed in.

ApplyStyle(Style)

将指定样式的所有非空白元素复制到 Web 控件,覆盖控件的所有现有的样式元素。Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. 此方法主要由控件开发人员使用。This method is primarily used by control developers.

(继承自 WebControl)
ApplyStyleSheetSkin(Page)

将页样式表中定义的样式属性应用到控件。Applies the style properties defined in the page style sheet to the control.

(继承自 Control)
BeginRenderTracing(TextWriter, Object)

开始输出数据的设计时追踪。Begins design-time tracing of rendering data.

(继承自 Control)
BuildProfileTree(String, Boolean)

收集有关服务器控件的信息并将该信息发送到 Trace 属性,在启用页的跟踪功能时将显示该属性。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(继承自 Control)
ClearCachedClientID()

将缓存的 ClientID 值设置为 nullSets the cached ClientID value to null.

(继承自 Control)
ClearChildControlState()

删除服务器控件的子控件的控件状态信息。Deletes the control-state information for the server control's child controls.

(继承自 Control)
ClearChildState()

删除服务器控件的所有子控件的视图状态和控件状态信息。Deletes the view-state and control-state information for all the server control's child controls.

(继承自 Control)
ClearChildViewState()

删除服务器控件的所有子控件的视图状态信息。Deletes the view-state information for all the server control's child controls.

(继承自 Control)
ClearEffectiveClientIDMode()

将当前控件实例和任何子控件的 ClientIDMode 属性设置为 InheritSets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(继承自 Control)
CopyBaseAttributes(WebControl)

Style 对象未封装的属性从指定的 Web 服务器控件复制到从中调用此方法的 Web 服务器控件。Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
CreateChildControls()

创建子控件。Creates child controls.

CreateControlCollection()

创建控件集合。Creates control collection.

CreateControlHierarchy()

创建构成控件的子控件的层次结构。Creates the hierarchy of child controls that make up the control.

CreateControlStyle()

创建控件样式。Creates control style.

DataBind()

将数据源绑定到 CompositeControl 及其所有子控件。Binds a data source to the CompositeControl and all its child controls.

(继承自 CompositeControl)
DataBind(Boolean)

将数据源绑定到调用的服务器控件及其所有子控件,同时可以选择引发 DataBinding 事件。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(继承自 Control)
DataBindChildren()

将数据源绑定到服务器控件的子控件。Binds a data source to the server control's child controls.

(继承自 Control)
Dispose()

使服务器控件得以在从内存中释放之前执行最后的清理操作。Enables a server control to perform final clean up before it is released from memory.

(继承自 Control)
EndRenderTracing(TextWriter, Object)

结束输出数据的设计时追踪。Ends design-time tracing of rendering data.

(继承自 Control)
EnsureChildControls()

确定服务器控件是否包含子控件。Determines whether the server control contains child controls. 如果不包含,则创建子控件。If it does not, it creates child controls.

(继承自 Control)
EnsureID()

为尚未分配标识符的控件创建标识符。Creates an identifier for controls that do not have an identifier assigned.

(继承自 Control)
Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
FindControl(String)

在当前的命名容器中搜索带指定 id 参数的服务器控件。Searches the current naming container for a server control with the specified id parameter.

(继承自 Control)
FindControl(String, Int32)

使用指定的 idpathOffset 参数(该参数有助于搜索)中指定的整数在当前命名容器中搜索服务器控件。Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. 不应重写此版本的 FindControl 方法。You should not override this version of the FindControl method.

(继承自 Control)
Focus()

为控件设置输入焦点。Sets input focus to a control.

(继承自 Control)
GetDesignModeState()

获取设计模式的状态。Gets the design mode state.

GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetHistory()

返回已经被访问过的 WizardStepBase 对象的集合。Returns a collection of WizardStepBase objects that have been accessed.

GetRouteUrl(Object)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(继承自 Control)
GetRouteUrl(RouteValueDictionary)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(继承自 Control)
GetRouteUrl(String, Object)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(继承自 Control)
GetRouteUrl(String, RouteValueDictionary)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(继承自 Control)
GetStepType(WizardStepBase, Int32)

返回指定的 WizardStepType 对象的 WizardStepBase 值。Returns the WizardStepType value for the specified WizardStepBase object.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetUniqueIDRelativeTo(Control)

返回指定控件的 UniqueID 属性的前缀部分。Returns the prefixed portion of the UniqueID property of the specified control.

(继承自 Control)
HasControls()

确定服务器控件是否包含任何子控件。Determines if the server control contains any child controls.

(继承自 Control)
HasEvents()

返回一个值,该值指示是否为控件或任何子控件注册事件。Returns a value indicating whether events are registered for the control or any child controls.

(继承自 Control)
IsLiteralContent()

确定服务器控件是否只包含文字内容。Determines if the server control holds only literal content.

(继承自 Control)
LoadControlState(Object)

还原控件状态信息。Restores control state information.

LoadViewState(Object)

加载视图状态信息。Loads view-state information.

MapPathSecure(String)

检索虚拟路径(绝对的或相对的)映射到的物理路径。Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(继承自 Control)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
MergeStyle(Style)

将指定样式的所有非空白元素复制到 Web 控件,但不覆盖该控件现有的任何样式元素。Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
MoveTo(WizardStepBase)

将指定的从 WizardStepBase 派生的对象设置为 ActiveStep 控件的 Wizard 属性的值。Sets the specified WizardStepBase-derived object as the value for the ActiveStep property of the Wizard control.

OnActiveStepChanged(Object, EventArgs)

引发 ActiveStepChanged 事件。Raises the ActiveStepChanged event.

OnBubbleEvent(Object, EventArgs)

确定服务器控件的事件是否沿页的用户界面服务器控件层次结构向上传递。Determines whether the event for the server control is passed up the page's user interface server control hierarchy.

OnCancelButtonClick(EventArgs)

引发 CancelButtonClick 事件。Raises the CancelButtonClick event.

OnDataBinding(EventArgs)

引发 DataBinding 事件。Raises the DataBinding event.

(继承自 Control)
OnFinishButtonClick(WizardNavigationEventArgs)

引发 FinishButtonClick 事件。Raises the FinishButtonClick event.

OnInit(EventArgs)

引发 Init 事件。Raises the Init event.

OnLoad(EventArgs)

引发 Load 事件。Raises the Load event.

(继承自 Control)
OnNextButtonClick(WizardNavigationEventArgs)

引发 NextButtonClick 事件。Raises the NextButtonClick event.

OnPreRender(EventArgs)

引发 PreRender 事件。Raises the PreRender event.

(继承自 Control)
OnPreviousButtonClick(WizardNavigationEventArgs)

引发 PreviousButtonClick 事件。Raises the PreviousButtonClick event.

OnSideBarButtonClick(WizardNavigationEventArgs)

引发 SideBarButtonClick 事件。Raises the SideBarButtonClick event.

OnUnload(EventArgs)

引发 Unload 事件。Raises the Unload event.

(继承自 Control)
OpenFile(String)

获取用于读取文件的 StreamGets a Stream used to read a file.

(继承自 Control)
RaiseBubbleEvent(Object, EventArgs)

将所有事件源及其信息分配给控件的父级。Assigns any sources of the event and its information to the control's parent.

(继承自 Control)
RecreateChildControls()

在派生自 CompositeControl 的控件中重新创建子控件。Recreates the child controls in a control derived from CompositeControl.

(继承自 CompositeControl)
RegisterCommandEvents(IButtonControl)

为指定的 CommandEventHandler 对象注册 IButtonControl 类的新实例。Registers a new instance of the CommandEventHandler class for the specified IButtonControl object.

RemovedControl(Control)

Control 对象的 Controls 集合移除子控件后调用。Called after a child control is removed from the Controls collection of the Control object.

(继承自 Control)
Render(HtmlTextWriter)

将控件呈现给指定的编写器。Renders the control to the specified writer.

RenderBeginTag(HtmlTextWriter)

将控件的 HTML 开始标记呈现到指定的编写器中。Renders the HTML opening tag of the control to the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
RenderChildren(HtmlTextWriter)

将服务器控件子级的内容输出到提供的 HtmlTextWriter 对象,该对象可写入要在客户端上呈现的内容。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(继承自 Control)
RenderContents(HtmlTextWriter)

将控件的内容呈现到指定的编写器中。Renders the contents of the control to the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
RenderControl(HtmlTextWriter)

将服务器控件内容输出到所提供的 HtmlTextWriter 对象,如果启用了跟踪,则还将存储有关该控件的跟踪信息。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(继承自 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的 HtmlTextWriter 对象将服务器控件内容输出到提供的 ControlAdapter 对象。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(继承自 Control)
RenderEndTag(HtmlTextWriter)

将控件的 HTML 结束标记呈现到指定的编写器中。Renders the HTML closing tag of the control into the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(继承自 WebControl)
ResolveAdapter()

获取负责呈现指定控件的控件适配器。Gets the control adapter responsible for rendering the specified control.

(继承自 Control)
ResolveClientUrl(String)

获取浏览器可以使用的 URL。Gets a URL that can be used by the browser.

(继承自 Control)
ResolveUrl(String)

将 URL 转换为在请求客户端可用的 URL。Converts a URL into one that is usable on the requesting client.

(继承自 Control)
SaveControlState()

保存控件状态。Save the control state.

SaveViewState()

保存视图状态。Saves the view state.

SetDesignModeState(IDictionary)

为控件设置设计时数据。Sets design-time data for a control.

(继承自 Control)
SetRenderMethodDelegate(RenderMethod)

分配事件处理程序委托,以将服务器控件及其内容呈现到父控件中。Assigns an event handler delegate to render the server control and its content into its parent control.

(继承自 Control)
SetTraceData(Object, Object)

使用跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(继承自 Control)
SetTraceData(Object, Object, Object)

使用跟踪对象、跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(继承自 Control)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)
TrackViewState()

跟踪视图状态。Tracks view state.

事件

ActiveStepChanged

当用户切换到控件中的新步骤时发生。Occurs when the user switches to a new step in the control.

CancelButtonClick

单击“取消”按钮时发生。Occurs when the Cancel button is clicked.

DataBinding

当服务器控件绑定到数据源时发生。Occurs when the server control binds to a data source.

(继承自 Control)
Disposed

当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(继承自 Control)
FinishButtonClick

单击“完成”按钮时发生。Occurs when the Finish button is clicked.

Init

当服务器控件初始化时发生;初始化是控件生存期的第一步。Occurs when the server control is initialized, which is the first step in its lifecycle.

(继承自 Control)
Load

当服务器控件加载到 Page 对象中时发生。Occurs when the server control is loaded into the Page object.

(继承自 Control)
NextButtonClick

单击“下一步”按钮时发生。Occurs when the Next button is clicked.

PreRender

在加载 Control 对象之后、呈现之前发生。Occurs after the Control object is loaded but prior to rendering.

(继承自 Control)
PreviousButtonClick

单击“上一步”按钮时发生。Occurs when the Previous button is clicked.

SideBarButtonClick

当单击侧栏区域中的按钮时发生。Occurs when a button in the sidebar area is clicked.

Unload

当服务器控件从内存中卸载时发生。Occurs when the server control is unloaded from memory.

(继承自 Control)

显式接口实现

IAttributeAccessor.GetAttribute(String)

获取具有指定名称的 Web 控件的特性。Gets an attribute of the Web control with the specified name.

(继承自 WebControl)
IAttributeAccessor.SetAttribute(String, String)

将 Web 控件的特性设置为指定的名称和值。Sets an attribute of the Web control to the specified name and value.

(继承自 WebControl)
ICompositeControlDesignerAccessor.RecreateChildControls()

启用设计器,以便在设计时环境中重新创建子控件的复合控件集合。Enables a designer to recreate the composite control's collection of child controls in the design-time environment.

(继承自 CompositeControl)
IControlBuilderAccessor.ControlBuilder

有关此成员的说明,请参见 ControlBuilderFor a description of this member, see ControlBuilder.

(继承自 Control)
IControlDesignerAccessor.GetDesignModeState()

有关此成员的说明,请参见 GetDesignModeState()For a description of this member, see GetDesignModeState().

(继承自 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

有关此成员的说明,请参见 SetDesignModeState(IDictionary)For a description of this member, see SetDesignModeState(IDictionary).

(继承自 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

有关此成员的说明,请参见 SetOwnerControl(Control)For a description of this member, see SetOwnerControl(Control).

(继承自 Control)
IControlDesignerAccessor.UserData

有关此成员的说明,请参见 UserDataFor a description of this member, see UserData.

(继承自 Control)
IDataBindingsAccessor.DataBindings

有关此成员的说明,请参见 DataBindingsFor a description of this member, see DataBindings.

(继承自 Control)
IDataBindingsAccessor.HasDataBindings

有关此成员的说明,请参见 HasDataBindingsFor a description of this member, see HasDataBindings.

(继承自 Control)
IExpressionsAccessor.Expressions

有关此成员的说明,请参见 ExpressionsFor a description of this member, see Expressions.

(继承自 Control)
IExpressionsAccessor.HasExpressions

有关此成员的说明,请参见 HasExpressionsFor a description of this member, see HasExpressions.

(继承自 Control)
IParserAccessor.AddParsedSubObject(Object)

有关此成员的说明,请参见 AddParsedSubObject(Object)For a description of this member, see AddParsedSubObject(Object).

(继承自 Control)

扩展方法

FindDataSourceControl(Control)

返回与指定控件的数据控件关联的数据源。Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String)

返回指定控件的命名容器中指定列的字段模板。Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control)

返回包含数据控件的元表对象。Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer)

为指定数据控件获取默认值的集合。Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer)

为指定数据控件获取表元数据。Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable)

为指定数据控件设置表元数据。Sets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

为指定数据控件设置表元数据和默认值映射。Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object)

为指定数据控件设置表元数据和默认值映射。Sets the table metadata and default value mapping for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable)

确定表元数据是否可用。Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

适用于

另请参阅