MultiView 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示作为一组 View 控件的容器的控件。
public ref class MultiView : System::Web::UI::Control
public class MultiView : System.Web.UI.Control
type MultiView = class
inherit Control
Public Class MultiView
Inherits Control
- 继承
示例
下面的代码示例演示如何使用 MultiView 控件创建基本调查。 每个 View 控件都是单独的调查问题。 当用户单击任何页面上的“ 上一个 ”按钮时,属性 ActiveViewIndex 将递减以导航到上一个 View 控件。 当用户单击任何页面上的 “下一步 ”按钮时,属性 ActiveViewIndex 将递增以导航到下一个 View 控件。
注意
以下代码示例使用单文件代码模型,如果直接复制到代码隐藏文件中,可能无法正常工作。 此代码示例必须复制到扩展名为 .aspx 的空文本文件中。 有关 Web 窗体代码模型的详细信息,请参阅 ASP.NET Web 窗体页代码模型。
<%@ Page Language="C#" %>
<!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>
<title>MultiView ActiveViewIndex Example</title>
<script runat="server">
protected void NextButton_Command(object sender, EventArgs e)
{
// Determine which button was clicked
// and set the ActiveViewIndex property to
// the view selected by the user.
if (DevPollMultiView.ActiveViewIndex > -1 & DevPollMultiView.ActiveViewIndex < 3)
{
// Increment the ActiveViewIndex property
// by one to advance to the next view.
DevPollMultiView.ActiveViewIndex += 1;
}
else if (DevPollMultiView.ActiveViewIndex == 3)
{
// This is the final view.
// The user wants to save the survey results.
// Insert code here to save survey results.
// Disable the navigation buttons.
Page4Save.Enabled = false;
Page4Restart.Enabled = false;
}
else
{
throw new Exception("An error occurred.");
}
}
protected void BackButton_Command(object sender, EventArgs e)
{
if (DevPollMultiView.ActiveViewIndex > 0 & DevPollMultiView.ActiveViewIndex <= 2)
{
// Decrement the ActiveViewIndex property
// by one to return to the previous view.
DevPollMultiView.ActiveViewIndex -= 1;
}
else if (DevPollMultiView.ActiveViewIndex == 3)
{
// This is the final view.
// The user wants to restart the survey.
// Return to the first view.
DevPollMultiView.ActiveViewIndex = 0;
}
else
{
throw new Exception("An error occurred.");
}
}
</script>
</head>
<body>
<form id="Form1" runat="Server">
<h3>MultiView ActiveViewIndex Example</h3>
<asp:Panel id="Page1ViewPanel"
Width="330px"
Height="150px"
HorizontalAlign="Left"
Font-size="12"
BackColor="#C0C0FF"
BorderColor="#404040"
BorderStyle="Double"
runat="Server">
<asp:MultiView id="DevPollMultiView"
ActiveViewIndex="0"
runat="Server">
<asp:View id="Page1"
runat="Server">
<asp:Label id="Page1Label"
Font-bold="true"
Text="What kind of applications do you develop?"
runat="Server"
AssociatedControlID="Page1">
</asp:Label><br /><br />
<asp:RadioButton id="Page1Radio1"
Text="Web Applications"
Checked="False"
GroupName="RadioGroup1"
runat="server" >
</asp:RadioButton><br />
<asp:RadioButton id="Page1Radio2"
Text="Windows Forms Applications"
Checked="False"
GroupName="RadioGroup1"
runat="server" >
</asp:RadioButton><br /><br /><br />
<asp:Button id="Page1Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat= "Server">
</asp:Button>
</asp:View>
<asp:View id="Page2"
runat="Server">
<asp:Label id="Page2Label"
Font-bold="true"
Text="How long have you been a developer?"
runat="Server"
AssociatedControlID="Page2">
</asp:Label><br /><br />
<asp:RadioButton id="Page2Radio1"
Text="Less than five years"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page2Radio2"
Text="More than five years"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br /><br /><br />
<asp:Button id="Page2Back"
Text = "Previous"
OnClick="BackButton_Command"
Height="25"
Width="70"
runat= "Server">
</asp:Button>
<asp:Button id="Page2Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button>
</asp:View>
<asp:View id="Page3"
runat="Server">
<asp:Label id="Page3Label1"
Font-bold="true"
Text= "What is your primary programming language?"
runat="Server"
AssociatedControlID="Page3">
</asp:Label><br /><br />
<asp:RadioButton id="Page3Radio1"
Text="Visual Basic .NET"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page3Radio2"
Text="C#"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page3Radio3"
Text="C++"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br /><br />
<asp:Button id="Page3Back"
Text = "Previous"
OnClick="BackButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button>
<asp:Button id="Page3Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button><br />
</asp:View>
<asp:View id="Page4"
runat="Server">
<asp:Label id="Label1"
Font-bold="true"
Text = "Thank you for taking the survey."
runat="Server"
AssociatedControlID="Page4">
</asp:Label>
<br /><br /><br /><br /><br /><br />
<asp:Button id="Page4Save"
Text = "Save Responses"
OnClick="NextButton_Command"
Height="25"
Width="110"
runat="Server">
</asp:Button>
<asp:Button id="Page4Restart"
Text = "Retake Survey"
OnClick="BackButton_Command"
Height="25"
Width="110"
runat= "Server">
</asp:Button>
</asp:View>
</asp:MultiView>
</asp:Panel>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!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>
<title>MultiView ActiveViewIndex Example</title>
<script runat="server">
Sub NextButton_Command(sender As Object, e As System.EventArgs)
' Determine which button was clicked
' and set the ActiveViewIndex property to
' the view selected by the user.
If (DevPollMultiView.ActiveViewIndex > -1) AND DevPollMultiView.ActiveViewIndex < 3 Then
' Increment the ActiveViewIndex property
' by one to advance to the next view.
DevPollMultiView.ActiveViewIndex += 1
ElseIf DevPollMultiView.ActiveViewIndex = 3 Then
' This is the final view.
' The user wants to save the survey results.
' Insert code here to save survey results.
' Disable the navigation buttons.
Page4Save.Enabled = False
Page4Restart.Enabled = False
Else
Throw New Exception("An error occurred.")
End If
End Sub
Sub BackButton_Command(ByVal sender As Object, ByVal e As System.EventArgs)
If (DevPollMultiView.ActiveViewIndex > 0) And DevPollMultiView.ActiveViewIndex <= 2 Then
' Decrement the ActiveViewIndex property
' by one to return to the previous view.
DevPollMultiView.ActiveViewIndex -= 1
ElseIf DevPollMultiView.ActiveViewIndex = 3 Then
' This is the final view.
' The user wants to restart the survey.
' Return to the first view.
DevPollMultiView.ActiveViewIndex = 0
Else
Throw New Exception("An error occurred.")
End If
End Sub
</script>
</head>
<body>
<form id="Form1" runat="Server">
<h3>MultiView ActiveViewIndex Example</h3>
<asp:Panel id="Page1ViewPanel"
Width="330px"
Height="150px"
HorizontalAlign ="Left"
Font-size="12"
BackColor="#C0C0FF"
BorderColor="#404040"
BorderStyle="Double"
runat="Server">
<asp:MultiView id="DevPollMultiView"
ActiveViewIndex="0"
runat="Server">
<asp:View id="Page1"
runat="Server">
<asp:Label id="Page1Label"
Font-bold="true"
Text="What kind of applications do you develop?"
runat="Server"
AssociatedControlID="Page1">
</asp:Label><br /><br />
<asp:RadioButton id="Page1Radio1"
Text="Web Applications"
Checked="False"
GroupName="RadioGroup1"
runat="server" >
</asp:RadioButton><br />
<asp:RadioButton id="Page1Radio2"
Text="Windows Forms Applications"
Checked="False"
GroupName="RadioGroup1"
runat="server" >
</asp:RadioButton><br /><br /><br />
<asp:Button id="Page1Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat= "Server">
</asp:Button>
</asp:View>
<asp:View id="Page2"
runat="Server">
<asp:Label id="Page2Label"
Font-bold="true"
Text="How long have you been a developer?"
runat="Server"
AssociatedControlID="Page2">
</asp:Label><br /><br />
<asp:RadioButton id="Page2Radio1"
Text="Less than five years"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page2Radio2"
Text="More than five years"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br /><br /><br />
<asp:Button id="Page2Back"
Text = "Previous"
OnClick="BackButton_Command"
Height="25"
Width="70"
runat= "Server">
</asp:Button>
<asp:Button id="Page2Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button>
</asp:View>
<asp:View id="Page3"
runat="Server">
<asp:Label id="Page3Label1"
Font-bold="true"
Text= "What is your primary programming language?"
runat="Server"
AssociatedControlID="Page3">
</asp:Label><br /><br />
<asp:RadioButton id="Page3Radio1"
Text="Visual Basic .NET"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page3Radio2"
Text="C#"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br />
<asp:RadioButton id="Page3Radio3"
Text="C++"
Checked="False"
GroupName="RadioGroup1"
runat="Server">
</asp:RadioButton><br /><br />
<asp:Button id="Page3Back"
Text = "Previous"
OnClick="BackButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button>
<asp:Button id="Page3Next"
Text = "Next"
OnClick="NextButton_Command"
Height="25"
Width="70"
runat="Server">
</asp:Button><br />
</asp:View>
<asp:View id="Page4"
runat="Server">
<asp:Label id="Label1"
Font-bold="true"
Text = "Thank you for taking the survey."
runat="Server"
AssociatedControlID="Page4">
</asp:Label>
<br /><br /><br /><br /><br /><br />
<asp:Button id="Page4Save"
Text = "Save Responses"
OnClick="NextButton_Command"
Height="25"
Width="110"
runat="Server">
</asp:Button>
<asp:Button id="Page4Restart"
Text = "Retake Survey"
OnClick="BackButton_Command"
Height="25"
Width="110"
runat= "Server">
</asp:Button>
</asp:View>
</asp:MultiView>
</asp:Panel>
</form>
</body>
</html>
下面的代码示例演示如何创建包含三View个控件的基本MultiView控件。 用户从列表框中选择的视图设置为活动视图,并向用户显示。 有关 控件的 MultiView 更详细示例,请参阅本主题中提供的其他代码示例。
<%@ Page Language="VB" %>
<!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>
<title>MultiView Class Example</title>
<script runat="server">
Sub Index_Changed(ByVal Sender As Object, ByVal e As EventArgs)
' Set the active view to
' the view selected by the user.
Dim text As String = ViewListBox.SelectedItem.Text
Select Case (text)
Case "View1"
MultiView1.SetActiveView(View1)
Case "View2"
MultiView1.SetActiveView(View2)
Case "View3"
MultiView1.SetActiveView(View3)
Case Else
Throw New Exception("You did not select a valid view.")
End Select
End Sub
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>MultiView Class Example</h3>
<h4>Select a View to display in a MultiView control:</h4>
<asp:ListBox id="ViewListBox"
Rows="1"
SelectionMode="Single"
AutoPostBack="True"
OnselectedIndexChanged="Index_Changed"
runat="Server">
<asp:ListItem Value="0">View1</asp:ListItem>
<asp:ListItem Value="1">View2</asp:ListItem>
<asp:ListItem Value="2">View3</asp:ListItem>
</asp:ListBox><br /><br />
<hr />
<asp:MultiView id="MultiView1"
runat="Server">
<asp:View id="View1"
runat="Server">
<asp:Label id="View1Label"
Font-bold="true"
Font-size="14"
Text="This is the content for View1."
runat="Server"
AssociatedControlID="View1">
</asp:Label>
</asp:View>
<asp:View id="View2"
runat="Server">
<asp:Label id="View2Label"
Font-bold="true"
Font-size="14"
Text="This is the content for View2."
runat="Server"
AssociatedControlID="View2">
</asp:Label>
</asp:View>
<asp:View id="View3"
runat="Server">
<asp:Label id="View3Label"
Font-bold="true"
Font-size="14"
Text="This is the content for View3."
runat="Server"
AssociatedControlID="View3">
</asp:Label>
</asp:View>
</asp:MultiView>
</form>
</body>
</html>
下面的代码示例演示如何创建包含三View个MultiView控件的控件。 控件 View 没有任何样式属性。 因此,每个 View 控件都包含一个 Panel 控件,用于在控件上 View 设置样式。 首次加载页面时, DefaultView
使用 SetActiveView 方法将 设置为活动视图。 每个 View 控件都包含链接按钮,允许用户导航到不同的视图。
<%@ Page Language="VB" %>
<!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>
<title>MultiView Class Example</title>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
' The first time the page loads,
' render the DefaultView.
If Not IsPostBack Then
' Set DefaultView as the active view.
MultiView1.SetActiveView(DefaultView)
End If
End Sub
Sub LinkButton_Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs)
' Determine which link button was clicked
' and set the active view to
' the view selected by the user.
Select Case (e.CommandArgument)
Case "DefaultView"
MultiView1.SetActiveView(DefaultView)
Case "News"
MultiView1.SetActiveView(NewsView)
Case "Shopping"
MultiView1.SetActiveView(ShoppingView)
Case Else
Throw New Exception("You did not select a valid list item.")
End Select
End Sub
</script>
</head>
<body>
<form id="Form1" runat="server">
<h3>MultiView Class Example</h3>
<asp:MultiView id="MultiView1"
runat="Server">
<asp:View id="DefaultView"
runat="Server">
<asp:Panel id="DefaultViewPanel"
Width="330px"
BackColor="#C0C0FF"
BorderColor="#404040"
BorderStyle="Double"
runat="Server">
<asp:Label id="DefaultLabel1"
Font-bold="true"
Font-size="14"
Text="The Default View"
runat="Server"
AssociatedControlID="DefaultView">
</asp:Label>
<asp:BulletedList id="DefaultBulletedList1"
BulletStyle="Disc"
DisplayMode="Hyperlink"
Target="_blank"
runat="Server">
<asp:ListItem Value="http://www.microsoft.com">Today's Weather</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Today's Stock Quotes</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Today's News Headlines</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Today's Featured Shopping</asp:ListItem>
</asp:BulletedList>
<hr />
<asp:Label id="DefaultLabel2"
Font-size="12"
Text="Click a link to display a different view:"
runat="Server">
</asp:Label><br />
<asp:LinkButton id="Default_NewsLink"
Text="Go to News View"
OnCommand="LinkButton_Command"
CommandArgument="News"
CommandName="Link"
Width="150px"
runat="Server">
</asp:LinkButton>
<asp:LinkButton id="Default_ShoppingLink"
Text="Go to Shopping View"
OnCommand="LinkButton_Command"
CommandArgument="Shopping"
CommandName="Link"
Width="150px"
runat="server">
</asp:LinkButton><br /><br />
</asp:Panel>
</asp:View>
<asp:View id="NewsView"
runat="Server">
<asp:Panel id="NewsPanel1"
Width="330px"
BackColor="#C0FFC0"
BorderColor="#404040"
BorderStyle="Double"
runat="Server">
<asp:Label id="NewsLabel1"
Font-bold="true"
Font-size="14"
Text="The News View"
runat="Server"
AssociatedControlID="NewsView">
</asp:Label>
<asp:BulletedList id="NewsBulletedlist1"
BulletStyle="Disc"
DisplayMode="Hyperlink"
Target="_blank"
runat="Server">
<asp:ListItem Value="http://www.microsoft.com">Today's International Headlines</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Today's National Headlines</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Today's Local News</asp:ListItem>
</asp:BulletedList>
<hr />
<asp:Label id="NewsLabel2"
Font-size="12"
Text="Click a link to display a different view:"
runat="Server">
</asp:Label><br />
<asp:LinkButton id="News_DefaultLink"
Text="Go to the Default View"
OnCommand="LinkButton_Command"
CommandArgument="DefaultView"
CommandName="Link"
Width="150px"
runat="Server">
</asp:LinkButton>
<asp:LinkButton id="News_ShoppingLink"
Text="Go to Shopping View"
OnCommand="LinkButton_Command"
CommandArgument="Shopping"
CommandName="Link"
Width="150px"
runat="Server">
</asp:LinkButton><br /><br />
</asp:Panel>
</asp:View>
<asp:View id="ShoppingView"
runat="Server">
<asp:Panel id="ShoppingPanel1"
Width="330px"
BackColor="#FFFFC0"
BorderColor="#404040"
BorderStyle="Double"
runat="Server">
<asp:Label id="ShoppingLabel1"
Font-Bold="true"
Font-size="14"
Text="The Shopping View"
runat="Server"
AssociatedControlID="ShoppingView">
</asp:Label>
<asp:BulletedList id="ShoppingBulletedlist1"
BulletStyle="Disc"
DisplayMode="Hyperlink"
Target="_blank"
runat="Server">
<asp:ListItem Value="http://www.microsoft.com">Shop for Home and Garden </asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Shop for Women's Fashions</asp:ListItem>
<asp:ListItem Value="http://www.microsoft.com">Shop for Men's Fashions</asp:ListItem>
</asp:BulletedList>
<hr />
<asp:Label id="ShoppingLabel2"
Font-size="12"
Text="Click a link to display a different view:"
runat="Server">
</asp:Label><br />
<asp:LinkButton id="Shopping_DefaultLink"
Text="Go to the Default View"
OnCommand="LinkButton_Command"
CommandArgument="DefaultView"
CommandName="Link"
Width="150px"
runat="Server">
</asp:LinkButton>
<asp:LinkButton id="Shopping_NewsLink"
Text="Go to News View"
OnCommand="LinkButton_Command"
CommandArgument="News"
CommandName="Link"
Width="150px"
runat="Server">
</asp:LinkButton><br /><br />
</asp:Panel>
</asp:View>
</asp:MultiView>
</form>
</body>
</html>
注解
本主题内容:
介绍
控件 MultiView 是一组控件的 View 容器。 它允许定义一组 View 控件,其中每个 View 控件都包含子控件。 然后,应用程序可以根据条件(例如用户标识、用户首选项以及在查询字符串参数中传递的信息)向客户端呈现特定的 View 控件。 还可以使用 MultiView 控件创建向导。 在此方案中,控件中包含的MultiView每个View控件都表示向导中的不同步骤或页面。 还应使用此控件为移动设备开发多屏幕应用程序。 此控件提供的功能与 .NET Framework 版本 1.1 中的 ASP.NET 移动 Form 控件相同。
一次只能将一个 View 控件定义为控件中的 MultiView 活动视图。 View将控件定义为活动视图时,它将包含的子控件呈现给客户端。 可以使用 ActiveViewIndex 属性或 SetActiveView 方法定义活动视图。 ActiveViewIndex如果 属性为空,则MultiView控件不会向客户端呈现任何内容。 如果活动视图设置为 View 控件中不存在的 MultiView , ArgumentOutOfRangeException 则会在运行时引发 。
可以通过声明方式或编程方式定义活动视图。 ActiveViewIndex在定义MultiView控件时以声明方式设置 属性会导致View设置为活动视图的控件在首次调用控件MultiView时呈现给客户端。 下面的代码示例演示如何以声明方式设置 ActiveViewIndex 属性。
<asp:MultiView id="MultiView1" ActiveViewIndex=0 runat="Server">
ActiveViewIndex通过编程方式设置 属性或调用 SetActiveView 方法,应用程序可以根据用户的标识或首选项等条件确定View在运行时要呈现给客户端的控件。
若要允许用户在控件内的控件之间View导航,可以向每个View控件添加 LinkButton 或 Button 控件。MultiView 若要利用 MultiView 控件对当前活动的 View自动更新,请将按钮或链接按钮上的 属性设置为 CommandName
与所需导航行为对应的以下命令名称字段之一的值: PreviousViewCommandName、 NextViewCommandName、 SwitchViewByIDCommandName或 SwitchViewByIndexCommandName。
声明性语法
<asp:MultiView
ActiveViewIndex="integer"
EnableTheming="True|False"
EnableViewState="True|False"
ID="string"
OnActiveViewChanged="ActiveViewChanged event handler"
OnDataBinding="DataBinding 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"
Visible="True|False"
>
<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:View
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"
Visible="True|False"
/>
<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"
/>
</asp:MultiView>
构造函数
MultiView() |
初始化 MultiView 类的新实例。 |
字段
NextViewCommandName | |
PreviousViewCommandName | |
SwitchViewByIDCommandName | |
SwitchViewByIndexCommandName |
表示命令名,该命令名与更改 View 控件的活动 MultiView 控件关联,这种更改是根据指定的 View 索引进行的。 此字段为只读。 |
属性
ActiveViewIndex | |
Adapter |
获取控件的浏览器特定适配器。 (继承自 Control) |
AppRelativeTemplateSourceDirectory |
获取或设置包含该控件的 Page 或 UserControl 对象的应用程序相对虚拟目录。 (继承自 Control) |
BindingContainer |
获取包含该控件的数据绑定的控件。 (继承自 Control) |
ChildControlsCreated |
获取一个值,该值指示是否已创建服务器控件的子控件。 (继承自 Control) |
ClientID |
获取由 ASP.NET 生成的 HTML 标记的控件 ID。 (继承自 Control) |
ClientIDMode |
获取或设置用于生成 ClientID 属性值的算法。 (继承自 Control) |
ClientIDSeparator |
获取一个字符值,该值表示 ClientID 属性中使用的分隔符字符。 (继承自 Control) |
Context |
为当前 Web 请求获取与服务器控件关联的 HttpContext 对象。 (继承自 Control) |
Controls |
获取 ControlCollection 对象,该对象表示 UI 层次结构中的指定服务器控件的子控件。 (继承自 Control) |
DataItemContainer |
如果命名容器实现 IDataItemContainer,则获取对命名容器的引用。 (继承自 Control) |
DataKeysContainer |
如果命名容器实现 IDataKeysControl,则获取对命名容器的引用。 (继承自 Control) |
DesignMode |
获取一个值,该值指示是否正在使用设计图面上的一个控件。 (继承自 Control) |
EnableTheming |
获取或设置一个值,该值指示是否向 MultiView 控件应用主题。 |
EnableViewState |
获取或设置一个值,该值指示服务器控件是否向发出请求的客户端保持自己的视图状态以及它所包含的任何子控件的视图状态。 (继承自 Control) |
Events |
获取控件的事件处理程序委托列表。 此属性为只读。 (继承自 Control) |
HasChildViewState |
获取一个值,该值指示当前服务器控件的子控件是否具有任何已保存的视图状态设置。 (继承自 Control) |
ID |
获取或设置分配给服务器控件的编程标识符。 (继承自 Control) |
IdSeparator |
获取用于分隔控件标识符的字符。 (继承自 Control) |
IsChildControlStateCleared |
获取一个值,该值指示该控件中包含的控件是否具有控件状态。 (继承自 Control) |
IsTrackingViewState |
获取一个值,用于指示服务器控件是否会将更改保存到其视图状态中。 (继承自 Control) |
IsViewStateEnabled |
获取一个值,该值指示是否为该控件启用了视图状态。 (继承自 Control) |
LoadViewStateByID |
获取一个值,该值指示控件是否通过 ID 而不是索引参与加载其视图状态。 (继承自 Control) |
NamingContainer |
获取对服务器控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 ID 属性值的服务器控件。 (继承自 Control) |
Page |
获取对包含服务器控件的 Page 实例的引用。 (继承自 Control) |
Parent |
获取对页 UI 层次结构中服务器控件的父控件的引用。 (继承自 Control) |
RenderingCompatibility |
获取一个值,该值指定呈现的 HTML 将与之兼容的 ASP.NET 版本。 (继承自 Control) |
Site |
获取容器信息,该容器在呈现于设计图面上时承载当前控件。 (继承自 Control) |
SkinID |
获取或设置要应用于控件的外观。 (继承自 Control) |
TemplateControl |
获取或设置对包含该控件的模板的引用。 (继承自 Control) |
TemplateSourceDirectory |
获取包含当前服务器控件的 Page 或 UserControl 的虚拟目录。 (继承自 Control) |
UniqueID |
获取服务器控件的唯一的、以分层形式限定的标识符。 (继承自 Control) |
ValidateRequestMode |
获取或设置指示控件是否检查来自浏览器的客户端输入是否具有潜在危险值的值。 (继承自 Control) |
Views | |
ViewState |
获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原服务器控件的视图状态。 (继承自 Control) |
ViewStateIgnoresCase |
获取一个值,该值指示 StateBag 对象是否不区分大小写。 (继承自 Control) |
ViewStateMode |
获取或设置此控件的视图状态模式。 (继承自 Control) |
Visible |
获取或设置一个值,该值指示服务器控件是否作为 UI 呈现在页上。 (继承自 Control) |
方法
事件
ActiveViewChanged | |
DataBinding |
当服务器控件绑定到数据源时发生。 (继承自 Control) |
Disposed |
当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。 (继承自 Control) |
Init |
当服务器控件初始化时发生;初始化是控件生存期的第一步。 (继承自 Control) |
Load |
当服务器控件加载到 Page 对象中时发生。 (继承自 Control) |
PreRender |
在加载 Control 对象之后、呈现之前发生。 (继承自 Control) |
Unload |
当服务器控件从内存中卸载时发生。 (继承自 Control) |
显式接口实现
IControlBuilderAccessor.ControlBuilder |
有关此成员的说明,请参见 ControlBuilder。 (继承自 Control) |
IControlDesignerAccessor.GetDesignModeState() |
有关此成员的说明,请参见 GetDesignModeState()。 (继承自 Control) |
IControlDesignerAccessor.SetDesignModeState(IDictionary) |
有关此成员的说明,请参见 SetDesignModeState(IDictionary)。 (继承自 Control) |
IControlDesignerAccessor.SetOwnerControl(Control) |
有关此成员的说明,请参见 SetOwnerControl(Control)。 (继承自 Control) |
IControlDesignerAccessor.UserData |
有关此成员的说明,请参见 UserData。 (继承自 Control) |
IDataBindingsAccessor.DataBindings |
有关此成员的说明,请参见 DataBindings。 (继承自 Control) |
IDataBindingsAccessor.HasDataBindings |
有关此成员的说明,请参见 HasDataBindings。 (继承自 Control) |
IExpressionsAccessor.Expressions |
有关此成员的说明,请参见 Expressions。 (继承自 Control) |
IExpressionsAccessor.HasExpressions |
有关此成员的说明,请参见 HasExpressions。 (继承自 Control) |
IParserAccessor.AddParsedSubObject(Object) |
有关此成员的说明,请参见 AddParsedSubObject(Object)。 (继承自 Control) |
扩展方法
FindDataSourceControl(Control) |
返回与指定控件的数据控件关联的数据源。 |
FindFieldTemplate(Control, String) |
返回指定控件的命名容器中指定列的字段模板。 |
FindMetaTable(Control) |
返回包含数据控件的元表对象。 |