Wizard 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供導航與使用者介面(UI),以收集跨多步驟的相關資料。
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 控制以收集使用者姓名與地址,並可選擇輸入獨立的運送地址。 若使用者未選擇 SeparateShipping CheckBox,未發出新增運送地址的請求, Wizard 控制項會直接 Step2 從 移動到 Finish。 在此Finish步驟中,使用者可選擇點擊 GoBackButton 回到控制項的起始Wizard;但Step2因為 AllowReturn 的Step1屬性設定為 false。
這很重要
此範例中有一個文字框可接受使用者輸入,這可能構成安全威脅。 預設情況下,ASP.NET 網頁會驗證使用者輸入中不包含腳本或 HTML 元素。 欲了解更多資訊,請參閱 腳本漏洞概述。
<%@ 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>
以下程式碼範例是前述範例所用網頁的程式碼背後檔案。
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
備註
本主題內容:
簡介
你可以用這個 Wizard 控制來:
收集多個步驟相關的資料。
將一個用於收集用戶輸入的大型網頁拆分成較小的邏輯步驟。
允許透過步驟進行線性或非線性導航。
Wizard 元件
Wizard控制系統由以下組件組成:
一 WizardStepCollection 組步驟,包含每個步驟的使用者介面,由頁面開發者定義。
內建導航功能,根據數值決定顯示 StepType 的按鈕。
一個可自訂以顯示使用者當前步驟特定資訊的標頭區域。
側邊欄區域可快速導航到控制步驟。
備註
如果你使用 Microsoft Visual Studio 2005,請注意 這些 是 ActiveStepIndex 持續存在於原始碼檢視中。 如果你在設計檢視中點擊側邊欄按鈕更改 WizardSteps 屬性,然後執行頁面,控制項的第一步
Wizard可能不會顯示,因為它 ActiveStepIndex 指向的是不同的步驟。
巫師階梯
控制項中的 Wizard 每個步驟都有 StepType 一個屬性,決定該步驟的導航功能類型。 若未指定屬性值 StepType ,預設值為 Auto。下表列出該屬性的可用設定 StepType 及步驟的行為。
WizardStepType.Auto 該步驟所呈現的導航介面,取決於該步驟宣告的順序。
WizardStepType.Complete 階梯是最後出現的階梯。 沒有顯示任何導航按鈕。
WizardStepType.Finish 這個步驟是最後一個收集使用者資料的步驟。
完成按鈕是用來導航的。
WizardStepType.Start 階梯是第一個出現的。 「 上一 頁」按鈕不會被渲染。
WizardStepType.Step 這個步驟是指介於第一步和最後一步之間的任何一步。
上一 頁和 下一 頁按鈕會被渲染成用於導航。
收集 Wizard 資料
利用此 Wizard 控制系統,可透過線性或非線性導航收集資料。 非線性導航的例子包括跳過不必要的步驟或返回先前已完成的步驟以更改某些數值。 Wizard控制項會在步驟間維持狀態,因此在步驟中輸入的資料,直到所有步驟完成前Wizard,都不需要將資料儲存。
或者,如果你想在每個步驟完成時(例如事件被觸發時NextButtonClick)將收集的資料持久化到資料庫,你應該將物件屬性WizardStepBase設定AllowReturn為 ,false讓使用者無法回到先前完成的步驟並更改資料。
巫師指令名稱
Wizard控制項繼承了以下指令名稱,分別來自View類別與MultiView類別:NextViewCommandName、、 PreviousViewCommandNameSwitchViewByIDCommandNameSwitchViewByIndexCommandName、 和 。 精靈控制鍵忽略這些指令名稱,且不包含任何特殊邏輯來讓這些指令自動用於導航。 若指令名稱被移除或控制按鈕缺少 Wizard ,則不會拋出例外。 例如,若 StartNavigationTemplate 按鈕缺少 的 CommandName值,則不會拋出例外。
動態變動的步驟
你可以用方法 MoveTo 或屬性 ActiveStepIndex 動態改變目前控制項中顯示 Wizard 的步驟。
備註
如果你在事件處理程序中程式化地新增 a WizardStepPage_Load ,必須在頁面載入前先加上該步驟的導覽。
巫師形象
控制鍵的外觀 Wizard 可透過範本、皮膚和風格設定完全自訂。 例如,你可以使用 HeaderTemplate、 SideBarTemplate、 StartNavigationTemplate、 FinishNavigationTemplateStepNavigationTemplate 和 properties 來自訂控制介面Wizard。
備註
設定 、 DisplaySideBar、 HeaderTemplate、 SideBarTemplate或 StartNavigationTemplateStepNavigationTemplate 屬性會FinishNavigationTemplate重新建立該Wizard控制項的子控制項。 因此,子控制項的視圖狀態在此過程中遺失。 為避免這種情況,請明確維持控制 Wizard 項子控制項的控制狀態,或避免將控制項置於範本中。
請注意,該 Wizard 控制項不支援針對非標準或怪異模式的特殊 Microsoft Internet Explorer 渲染。 要使用控制項獲得最佳的 Internet Explorer 渲染 Wizard 效果,請使用 XHTML 文件類型,這是 Visual Web Developer 和 Visual Studio 預設新增的。
使用版面範本的格式化
這個 Wizard 控制項讓你可以指定控制項的配置,而不需要使用 HTML table 元素。 你可以用元素 LayoutTemplate 來指定版面配置。 在範本中,你可以建立佔位控制,指示項目應該動態插入控制項的位置。 (這與控制的模板模型ListView運作方式相似。)欲了解更多資訊,請參閱該物業。Wizard.LayoutTemplate
無障礙設施
關於如何配置此控制項以產生符合無障礙標準的標記,請參閱 Visual Studio 中的無障礙,ASP.NETASP.NET 控制項與無障礙。
宣告式語法
<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>
建構函式
| 名稱 | Description |
|---|---|
| Wizard() |
初始化 Wizard 類別的新執行個體。 |
欄位
| 名稱 | Description |
|---|---|
| CancelButtonID |
指定 取消 按鈕的識別碼。 此欄位為靜態且唯讀。 |
| CancelCommandName |
取得 取消 按鈕的指令名稱。 此欄位為靜態且唯讀。 |
| CustomFinishButtonID |
取得自訂 完成 按鈕的識別碼。 此欄位為靜態且唯讀。 |
| CustomNextButtonID |
取得自訂 「下一頁 」按鈕的識別碼。 此欄位為靜態且唯讀。 |
| CustomPreviousButtonID |
取得自訂 「上一頁 」按鈕的識別碼。 此欄位為靜態且唯讀。 |
| DataListID |
取得側邊欄 DataList 集合的識別碼。 此欄位為靜態且唯讀。 |
| FinishButtonID |
取得 完成 按鈕的識別碼。 此欄位為靜態且唯讀。 |
| FinishPreviousButtonID |
取得步驟中Finish「上一」按鈕的識別碼。 此欄位為靜態且唯讀。 |
| HeaderPlaceholderId |
取得控制中佔位符Wizard的 HeaderTemplate ID。 |
| MoveCompleteCommandName |
取得與 完成 按鈕相關聯的指令名稱。 此欄位為靜態且唯讀。 |
| MoveNextCommandName |
取得與 「下一個 」按鈕相關聯的指令名稱。 此欄位為靜態且唯讀。 |
| MovePreviousCommandName |
擷取與 「上一」 按鈕相關聯的指令名稱。 此欄位為靜態且唯讀。 |
| MoveToCommandName |
擷取與每個側邊欄按鈕相關的指令名稱。 此欄位為靜態且唯讀。 |
| NavigationPlaceholderId |
取得控制中佔位符Wizard的 StartNavigationTemplate ID。 |
| SideBarButtonID |
擷取每個側邊欄按鈕所關聯的識別碼。 此欄位為靜態且唯讀。 |
| SideBarPlaceholderId |
取得控制中佔位符Wizard的 SideBarTemplate ID。 |
| StartNextButtonID |
取得與 步驟中「下一 」按鈕 Start 相關的識別碼。 此欄位為靜態且唯讀。 |
| StepNextButtonID |
取得與 「下一個 」按鈕相關的識別碼。 此欄位為靜態且唯讀。 |
| StepPreviousButtonID |
取得與 「上一 」按鈕相關的識別碼。 此欄位為靜態且唯讀。 |
| WizardStepPlaceholderId |
取得控制中佔位符Wizard的 WizardStep ID。 |
屬性
| 名稱 | Description |
|---|---|
| AccessKey |
取得或設定存取金鑰,讓你能快速導航到網頁伺服器控制。 (繼承來源 WebControl) |
| ActiveStep |
取得目前顯示給使用者的集合中 WizardSteps 步驟。 |
| ActiveStepIndex |
取得或設定當前 WizardStepBase 物件的索引。 |
| Adapter |
拿到瀏覽器專用的控制器轉接器。 (繼承來源 Control) |
| AppRelativeTemplateSourceDirectory |
取得或設定包含此控制項的 or UserControl 物件的Page應用程式相對虛擬目錄。 (繼承來源 Control) |
| Attributes |
取得一組任意屬性(僅用於渲染),這些屬性與控制項上的屬性不對應。 (繼承來源 WebControl) |
| BackColor |
取得或設定網頁伺服器控制項的背景色。 (繼承來源 WebControl) |
| BindingContainer |
取得包含該控制項資料綁定的控制項。 (繼承來源 Control) |
| BorderColor |
取得或設定網頁控制的邊框顏色。 (繼承來源 WebControl) |
| BorderStyle |
取得或設定網頁伺服器控制的邊界樣式。 (繼承來源 WebControl) |
| BorderWidth |
取得或設定網頁伺服器控制的邊界寬度。 (繼承來源 WebControl) |
| CancelButtonImageUrl |
取得或設定顯示圖片的網址,用於 取消 按鈕。 |
| CancelButtonStyle |
會獲得一組定義 取消 按鈕外觀的樣式屬性的參考。 |
| CancelButtonText |
取得或設定 取消按鈕所 顯示的文字說明。 |
| CancelButtonType |
取得或設定被渲染成 取消 按鈕的類型。 |
| CancelDestinationPageUrl |
它會取得或設定使用者點擊 取消 按鈕時被導向的網址。 |
| CellPadding |
取得或設定格子內容與格子邊界之間的空間大小。 |
| CellSpacing |
取得或設定格子間的距離。 |
| ChildControlsCreated |
會取得一個值,表示伺服器控制項的子控制項是否已被建立。 (繼承來源 Control) |
| ClientID |
取得由 ASP.NET 產生的 HTML 標記的控制 ID。 (繼承來源 Control) |
| ClientIDMode |
取得或設定用於產生屬性值 ClientID 的演算法。 (繼承來源 Control) |
| ClientIDSeparator |
會得到一個字元值,代表該屬性中使用 ClientID 的分隔符字元。 (繼承來源 Control) |
| Context |
取得 HttpContext 與伺服器控制項相關聯的物件,用於目前的網頁請求。 (繼承來源 Control) |
| Controls |
取得ControlCollection一個物件,代表子節點的控制。CompositeControl (繼承來源 CompositeControl) |
| ControlStyle |
這就有網頁伺服器控制的風格。 此特性主要由對照顯影劑使用。 (繼承來源 WebControl) |
| ControlStyleCreated |
會取得一個值,表示該屬性是否 Style 已建立 ControlStyle 物件。 此特性主要由控制顯影劑使用。 (繼承來源 WebControl) |
| CssClass |
取得或設定由網頁伺服器控制項在用戶端渲染的層疊樣式表(CSS)類別。 (繼承來源 WebControl) |
| DataItemContainer |
如果命名容器實 IDataItemContainer作 。 (繼承來源 Control) |
| DataKeysContainer |
如果命名容器實 IDataKeysControl作 。 (繼承來源 Control) |
| DesignMode |
會獲得一個值,表示是否在設計表面上使用控制項。 (繼承來源 Control) |
| DisplayCancelButton |
取得或設定一個布林值,指示是否顯示 取消 按鈕。 |
| DisplaySideBar |
取得或設定一個布林值,指示是否要在控制器上 Wizard 顯示側邊欄區域。 |
| Enabled |
取得或設定一個值,表示網頁伺服器控制是否已啟用。 (繼承來源 WebControl) |
| EnableTheming |
取得或設定一個值,指示主題是否適用於此控制。 (繼承來源 WebControl) |
| EnableViewState |
取得或設定一個值,指示伺服器控制項是否能持久化其視圖狀態,以及其包含的任何子控制項的視圖狀態,給請求端客戶端。 (繼承來源 Control) |
| Events |
會取得一個事件處理代理清單來管理控制。 這個屬性是唯讀的。 (繼承來源 Control) |
| FinishCompleteButtonImageUrl |
取得或設定顯示於 完成 按鈕上的圖片 URL。 |
| FinishCompleteButtonStyle |
會取得一個定義完成按鈕設定的物件參考Style。 |
| FinishCompleteButtonText |
取得或設定顯示在 完成 按鈕上的文字說明。 |
| FinishCompleteButtonType |
會取得或設定被渲染成 完成 按鈕的類型。 |
| FinishDestinationPageUrl |
它會取得或設定使用者點擊 完成 按鈕時被導向的網址。 |
| FinishNavigationTemplate |
取得或設定用於顯示步驟導航 Finish 區域的範本。 |
| FinishPreviousButtonImageUrl |
取得或設定該步驟「 上一 」按鈕 Finish 顯示的圖片 URL。 |
| FinishPreviousButtonStyle | |
| FinishPreviousButtonText |
取得或設定該步驟「 上一頁 」按鈕 Finish 顯示的文字說明。 |
| FinishPreviousButtonType |
取得或設定該步驟中被渲染為 上一 鍵 Finish 的按鈕類型。 |
| Font |
取得與網頁伺服器控制項相關的字型屬性。 (繼承來源 WebControl) |
| ForeColor |
取得或設定網頁伺服器控制項的前景顏色(通常是文字顏色)。 (繼承來源 WebControl) |
| HasAttributes |
會得到一個值,表示控制項是否設定了屬性。 (繼承來源 WebControl) |
| HasChildViewState |
會取得一個值,表示目前伺服器控制項的子控制項是否儲存了任何檢視狀態設定。 (繼承來源 Control) |
| HeaderStyle |
會取得一個物件的參考 Style ,該物件定義了控制項標頭區域的設定。 |
| HeaderTemplate |
取得或設定用於顯示控制項標頭區的範本。 |
| HeaderText |
取得或設定控制鍵標頭區顯示的文字說明。 |
| Height |
取得或設定網頁伺服器控制的高度。 (繼承來源 WebControl) |
| ID |
取得或設定分配給伺服器控制的程式識別碼。 (繼承來源 Control) |
| IdSeparator |
取得用來分離控制識別碼的字元。 (繼承來源 Control) |
| IsChildControlStateCleared |
會取得一個值,表示該控制中所包含的控制是否具有控制狀態。 (繼承來源 Control) |
| IsEnabled |
會得到一個值,表示該控制項是否已啟用。 (繼承來源 WebControl) |
| IsTrackingViewState |
會得到一個值,表示伺服器控制是否正在儲存對其檢視狀態的變更。 (繼承來源 Control) |
| IsViewStateEnabled |
會取得一個值,表示此控制是否啟用了檢視狀態。 (繼承來源 Control) |
| LayoutTemplate |
取得或設定根容器的自訂內容在控制 Wizard 項中。 |
| LoadViewStateByID |
會得到一個值,表示控制項是否參與載入其視圖狀態 ID ,而非索引。 (繼承來源 Control) |
| NamingContainer |
會取得伺服器控制項命名容器的參考,該容器會建立一個獨特的命名空間,用來區分具有相同 ID 屬性值的伺服器控制項。 (繼承來源 Control) |
| NavigationButtonStyle |
會取得一個物件的參考 Style ,該物件定義了控制鍵導航區按鈕的設定。 |
| NavigationStyle |
會取得一個物件的參考 Style ,該物件定義了控制鍵上導航區域的設定。 |
| Page |
會取得包含 Page 伺服器控制的實例參考。 (繼承來源 Control) |
| Parent |
在頁面控制階層中,會取得伺服器控制項的父控制權的參考。 (繼承來源 Control) |
| RenderingCompatibility |
會得到一個值,指定渲染後的 HTML 會相容的 ASP.NET 版本。 (繼承來源 Control) |
| SideBarButtonStyle |
會取得一個物件的參考 Style ,該物件定義了側邊欄按鈕的設定。 |
| SideBarStyle |
會取得一個物件的參考 Style ,該物件定義了控制鍵側邊欄區域的設定。 |
| SideBarTemplate |
取得或設定用來顯示控制鍵側邊欄區域的範本。 |
| Site |
當在設計表面渲染時,會取得承載當前控制項的容器資訊。 (繼承來源 Control) |
| SkinID |
取得或設定皮膚貼合控制劑。 (繼承來源 WebControl) |
| SkipLinkText |
取得或設定一個值,用來渲染替代文字,通知螢幕閱讀器跳過側邊欄區域的內容。 |
| StartNavigationTemplate | |
| StartNextButtonImageUrl |
取得或設定顯示的圖片網址,用於步驟中的Start「下一個」按鈕。 |
| StartNextButtonStyle | |
| StartNextButtonText |
取得或設定顯示在 步驟「下一 」按鈕 Start 上的文字說明。 |
| StartNextButtonType |
取得或設定該步驟中被渲染為 下一步 按鈕 Start 的類型。 |
| StepNavigationTemplate |
取得或設定用於顯示除 、 Finish、 或 Complete 步驟外任何 WizardStepBase-衍生物件Start的導航區域的範本。 |
| StepNextButtonImageUrl |
取得或設定顯示的圖片網址,用於 「下一個 」按鈕。 |
| StepNextButtonStyle |
會得到一個定義「下一個」按鈕設定的物件參考Style。 |
| StepNextButtonText |
取得或設定顯示給 「下一頁 」按鈕的文字說明。 |
| StepNextButtonType |
取得或設定將被渲染為 「下一個 按鈕」的類型按鈕。 |
| StepPreviousButtonImageUrl |
取得或設定顯示於 「上一」 按鈕的圖片網址。 |
| StepPreviousButtonStyle |
會得到一個物件的參考 Style ,定義了 「上一 」按鈕的設定。 |
| StepPreviousButtonText |
取得或設定顯示 於「上一頁 」按鈕的文字說明。 |
| StepPreviousButtonType |
取得或設定將被渲染為 上一 按鈕的類型。 |
| StepStyle |
會取得一個物件的參考 Style ,該物件定義了該 WizardStep 物件的設定。 |
| Style |
會取得一組文字屬性,這些屬性會被渲染成 Web 伺服器控制項外層標籤上的樣式屬性。 (繼承來源 WebControl) |
| SupportsDisabledAttribute |
會取得一個值,指示當控制項IsEnabled屬性為 |
| TabIndex |
取得或設定網頁伺服器控制的分頁索引。 (繼承來源 WebControl) |
| TagKey |
取得 HtmlTextWriterTag 對應控制點 Wizard 的值。 |
| TagName |
取得控制標籤名稱。 此特性主要由對照顯影劑使用。 (繼承來源 WebControl) |
| TemplateControl |
取得或設定包含此控制項的範本參考。 (繼承來源 Control) |
| TemplateSourceDirectory |
取得包含當前伺服器控制權的 or UserControl 虛擬目錄Page。 (繼承來源 Control) |
| ToolTip |
當滑鼠指標懸停在網頁伺服器控制項上時,會取得或設定顯示的文字。 (繼承來源 WebControl) |
| UniqueID |
取得伺服器控制的唯一、階層限定的識別碼。 (繼承來源 Control) |
| ValidateRequestMode |
取得或設定一個值,指示控制器是否檢查瀏覽器的客戶端輸入是否有潛在危險的值。 (繼承來源 Control) |
| ViewState |
取得狀態資訊字典,讓你能儲存並還原伺服器控制的多個請求,針對同一頁面。 (繼承來源 Control) |
| ViewStateIgnoresCase |
會得到一個值,表示該物件是否 StateBag 不區分大小寫。 (繼承來源 Control) |
| ViewStateMode |
取得或設定此控制的視圖狀態模式。 (繼承來源 Control) |
| Visible |
取得或設定一個值,指示伺服器控制項是否以 UI 形式呈現在頁面上。 (繼承來源 Control) |
| Width |
取得或設定網頁伺服器控制的寬度。 (繼承來源 WebControl) |
| WizardSteps |
會得到一個包含所有 WizardStepBase 為控制定義物件的集合。 |
方法
事件
| 名稱 | Description |
|---|---|
| ActiveStepChanged |
當使用者切換到控制中的新步驟時,會發生這種情況。 |
| CancelButtonClick |
當按下 取消 按鈕時會發生。 |
| DataBinding |
當伺服器控制項綁定到資料來源時會發生。 (繼承來源 Control) |
| Disposed |
當伺服器控制從記憶體中釋放時發生,這是伺服器控制生命週期中請求 ASP.NET 頁面的最後階段。 (繼承來源 Control) |
| FinishButtonClick |
當按下 完成 鍵時會發生。 |
| Init |
發生在伺服器控制初始化時,這是其生命週期的第一步。 (繼承來源 Control) |
| Load |
當伺服器控制項載入 Page 物件時會發生。 (繼承來源 Control) |
| NextButtonClick |
當按下 「下一個 」按鈕時發生。 |
| PreRender |
發生在物件載入後 Control 但渲染之前。 (繼承來源 Control) |
| PreviousButtonClick |
當點擊 上一 鍵時會發生。 |
| SideBarButtonClick |
當點擊側邊欄區域的按鈕時會發生。 |
| Unload |
當伺服器控制項從記憶體卸載時發生。 (繼承來源 Control) |
明確介面實作
擴充方法
| 名稱 | Description |
|---|---|
| EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) |
啟用指定資料控制的動態資料行為。 |
| EnableDynamicData(INamingContainer, Type, Object) |
啟用指定資料控制的動態資料行為。 |
| EnableDynamicData(INamingContainer, Type) |
啟用指定資料控制的動態資料行為。 |
| FindDataSourceControl(Control) |
回傳與指定控制項相關聯的資料來源。 |
| FindFieldTemplate(Control, String) |
回傳指定控制項命名容器中指定欄位的欄位範本。 |
| FindMetaTable(Control) |
回傳包含資料控制項的元值物件。 |
| GetDefaultValues(INamingContainer) |
取得指定資料控制項的預設值集合。 |
| GetMetaTable(INamingContainer) |
取得指定資料控制的表格元資料。 |
| SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) |
設定指定資料控制項的表格元資料及預設值映射。 |
| SetMetaTable(INamingContainer, MetaTable, Object) |
設定指定資料控制項的表格元資料及預設值映射。 |
| SetMetaTable(INamingContainer, MetaTable) |
設定指定資料控制項的資料表元資料。 |
| TryGetMetaTable(INamingContainer, MetaTable) |
判斷表格中繼資料是否可用。 |