語言

ControlPersister.PersistControl 方法

定義

取得一串資料,代表指定控制項的持久形式。

多載

名稱 Description
PersistControl(Control)

取得一串資料,代表指定控制項的持久形式。

PersistControl(TextWriter, Control)

輸出一串資料,代表指定控制項的持久形式,映射給指定的 TextWriter。

PersistControl(Control, IDesignerHost)

會取得一串資料,代表指定控制項的持久形式,使用指定的設計主機。

PersistControl(TextWriter, Control, IDesignerHost)

透過指定的設計主機,輸出一串代表指定控制的持久形式資料,傳送給指定的 TextWriter。

PersistControl(Control)

取得一串資料,代表指定控制項的持久形式。

public:
 static System::String ^ PersistControl(System::Web::UI::Control ^ control);
public static string PersistControl(System.Web.UI.Control control);
static member PersistControl : System.Web.UI.Control -> string
Public Shared Function PersistControl (control As Control) As String

參數

control
Control

堅持 Control 下去。

傳回

一個代表控制項持久形式的字串。

範例

// Parse the selected control.
String^ persistedData = ControlPersister::PersistControl( controlArray[ selectionForm->controlList->SelectedIndex ] );
// Parse the selected control into a persistence string.
string persistedData = ControlPersister.PersistControl(
    controlArray[selectionForm.controlList.SelectedIndex]);
' Parse the selected control.
Dim persistedData As String = ControlPersister.PersistControl( _
    controlArray(selectionForm.controlList.SelectedIndex))

備註

此方法需要實 IDesignerHost 作才能正確運作。 此方法利用指定控制項的 來 Site 檢索設計主機。

適用於

PersistControl(TextWriter, Control)

輸出一串資料,代表指定控制項的持久形式,映射給指定的 TextWriter。

public:
 static void PersistControl(System::IO::TextWriter ^ sw, System::Web::UI::Control ^ control);
public static void PersistControl(System.IO.TextWriter sw, System.Web.UI.Control control);
static member PersistControl : System.IO.TextWriter * System.Web.UI.Control -> unit
Public Shared Sub PersistControl (sw As TextWriter, control As Control)

參數

sw
TextWriter

輸出 TextWriter 持久化控制資料。

control
Control

堅持 Control 下去。

備註

此方法需要實 IDesignerHost 作才能正確運作。 此方法利用指定控制項的 來 Site 檢索設計主機。

適用於

PersistControl(Control, IDesignerHost)

會取得一串資料,代表指定控制項的持久形式,使用指定的設計主機。

public:
 static System::String ^ PersistControl(System::Web::UI::Control ^ control, System::ComponentModel::Design::IDesignerHost ^ host);
public static string PersistControl(System.Web.UI.Control control, System.ComponentModel.Design.IDesignerHost host);
static member PersistControl : System.Web.UI.Control * System.ComponentModel.Design.IDesignerHost -> string
Public Shared Function PersistControl (control As Control, host As IDesignerHost) As String

參數

control
Control

堅持 Control 下去。

host
IDesignerHost

而 IDesignerHost 那是控制系統的設計主機。

傳回

一個代表控制項持久形式的字串。

範例

// Parse the selected control.
String^ persistedData = ControlPersister::PersistControl( controlArray[ selectionForm->controlList->SelectedIndex ] );
// Parse the selected control into a persistence string.
string persistedData = ControlPersister.PersistControl(
    controlArray[selectionForm.controlList.SelectedIndex]);
' Parse the selected control.
Dim persistedData As String = ControlPersister.PersistControl( _
    controlArray(selectionForm.controlList.SelectedIndex))

備註

此方法需要實 IDesignerHost 作才能正確運作。

適用於

PersistControl(TextWriter, Control, IDesignerHost)

透過指定的設計主機,輸出一串代表指定控制的持久形式資料,傳送給指定的 TextWriter。

public:
 static void PersistControl(System::IO::TextWriter ^ sw, System::Web::UI::Control ^ control, System::ComponentModel::Design::IDesignerHost ^ host);
public static void PersistControl(System.IO.TextWriter sw, System.Web.UI.Control control, System.ComponentModel.Design.IDesignerHost host);
static member PersistControl : System.IO.TextWriter * System.Web.UI.Control * System.ComponentModel.Design.IDesignerHost -> unit
Public Shared Sub PersistControl (sw As TextWriter, control As Control, host As IDesignerHost)

參數

sw
TextWriter

輸出 TextWriter 持久化控制資料。

control
Control

堅持 Control 下去。

host
IDesignerHost

而 IDesignerHost 那是控制系統的設計主機。

備註

此方法需要實 IDesignerHost 作才能正確運作。

適用於