GenericWebPart.CreateEditorParts 方法

定義

傳回自訂 EditorPart 控制項的集合,在 GenericWebPart 控制項的子控制項處於編輯模式時,可以使用這些控制項編輯它。

public:
 override System::Web::UI::WebControls::WebParts::EditorPartCollection ^ CreateEditorParts();
public override System.Web.UI.WebControls.WebParts.EditorPartCollection CreateEditorParts ();
override this.CreateEditorParts : unit -> System.Web.UI.WebControls.WebParts.EditorPartCollection
Public Overrides Function CreateEditorParts () As EditorPartCollection

傳回

EditorPartCollection,包含與伺服器控制項相關聯的自訂 EditorPart 控制項。

備註

CreateEditorParts當控制項進入編輯顯示模式時,會呼叫 方法。 這個方法會覆寫繼承自 WebPart 類別的基底方法,因為在控制項的情況下,它是正在編輯的 GenericWebPart 子控制項,而不是 GenericWebPart 控制項本身。 方法 CreateEditorParts 會將子控制項 IWebEditable 轉換成 介面,讓控制項能夠編輯。

這個覆寫的方法可讓不衍生自 WebPart 類別的伺服器控制項,包括 ASP.NET 伺服器控制項,以及自訂伺服器控制項,以一般 WebPart 控制項編輯。

適用於

另請參閱