UpdateProgress.ProgressTemplate 屬性

定義

取得或設定用於定義 UpdateProgress 控制項內容的範本。Gets or sets the template that defines the content of the UpdateProgress control.

public:
 property System::Web::UI::ITemplate ^ ProgressTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.ITemplate ProgressTemplate { get; set; }
member this.ProgressTemplate : System.Web.UI.ITemplate with get, set
Public Property ProgressTemplate As ITemplate

屬性值

定義 ITemplate 控制項之內容的 UpdateProgress 執行個體。An ITemplate instance that defines the content of the UpdateProgress control. 預設為 nullThe default is null.

屬性

備註

必須定義範本。The template must be defined. 否則,在UpdateProgress控制項的Init事件期間會擲回例外狀況。Otherwise, an exception is thrown during the UpdateProgress control's Init event. 您可以藉由ProgressTemplate將標記新增ProgressTemplate至專案,以宣告方式指定屬性。You can specify the ProgressTemplate property declaratively by adding markup to the ProgressTemplate element. 如果專案中ProgressTemplate沒有任何標記,則不會顯示UpdateProgress控制項的任何內容。If there is no markup in the ProgressTemplate element, nothing is displayed for the UpdateProgress control.

如果您是以UpdateProgress動態方式建立控制項,您可以建立自訂範本, ITemplate從控制項繼承。If you are creating UpdateProgress controls dynamically, you can create a custom template that inherits from the ITemplate control. 您在InstantiateIn方法中指定標記,然後ProgressTemplate將動態建立UpdateProgress之控制項的屬性設定為自訂範本的新實例。You specify markup in the InstantiateIn method, and then set the ProgressTemplate property of the dynamically created UpdateProgress control to a new instance of the custom template. 如果您以UpdateProgress動態方式建立控制項,請在頁面PreRender事件期間或之前執行此動作。If you create UpdateProgress controls dynamically, do so during or before the PreRender event of the page. 如果您稍後在UpdateProgress頁面生命週期中建立控制項,則不會顯示進度。If you create the UpdateProgress control later in the page life cycle, progress is not displayed.

適用於

另請參閱