將指定的 View 控制項設為 MultiView 控制項中的現用檢視表。Sets the specified View control to the active view within a MultiView control.
public:
void SetActiveView(System::Web::UI::WebControls::View ^ view);
public void SetActiveView (System.Web.UI.WebControls.View view);
member this.SetActiveView : System.Web.UI.WebControls.View -> unit
Public Sub SetActiveView (view As View)
參數
view
要在 View 控制項中設為現用檢視表的 MultiView 控制項。A View control to set as the active view within a MultiView control.
例外狀況
指定的 view 參數值不包含在 MultiView 控制項中。The specified view parameter value was not contained in the MultiView control.
範例
下列範例示範如何建立 MultiView 包含三個控制項的控制項 View 。The following example demonstrates how to create a MultiView control that contains three View controls. 第一次載入頁面時, DefaultView 會使用方法將設定為現用視圖 SetActiveView 。The first time the page is loaded, the DefaultView is set as the active view using the SetActiveView method. 每個 View 控制項都包含連結按鈕,可讓使用者流覽至不同的視圖。Each View control contains link buttons to allow the user to navigate to different views.
注意
下列程式碼範例會使用單一檔案程式碼模型,如果直接複製到程式碼後端檔案,則可能無法正確運作。The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. 這個程式碼範例必須複製到副檔名為 .aspx 的空文字檔中。This code sample must be copied into an empty text file that has an .aspx extension. 如需 Web Form 程式碼模型的詳細資訊,請參閱 ASP.NET Web Forms 頁面程式碼模型。For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model.
/p>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&g