ScriptManager.ProfileService 屬性

定義

取得關聯到目前之 ProfileServiceManager 執行個體的 ScriptManager 物件。

public:
 property System::Web::UI::ProfileServiceManager ^ ProfileService { System::Web::UI::ProfileServiceManager ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.ProfileServiceManager ProfileService { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.ProfileService : System.Web.UI.ProfileServiceManager
Public ReadOnly Property ProfileService As ProfileServiceManager

屬性值

目前之 ProfileServiceManager 執行實體的 ScriptManager 物件。

屬性

備註

ProfileServiceManager這個屬性所傳回的物件代表向頁面註冊的設定檔服務。 設定檔服務可以在 控制項或相關聯的 ScriptManagerProxy 控制項中定義 ScriptManager

您可以使用 ASP.NET 設定檔服務,或使用自訂設定檔服務。 您可以在標記中新增自訂服務,方法是在頁面上的 元素內 asp:ScriptManager 加入 ProfileService 元素,如下列範例所示。

<asp:ScriptManager ID="SM1" runat="server">  
  <ProfileService LoadProperties="propertyA,propertyB"  
    Path="MyProfileService.asmx" />  
</asp:ScriptManager>  

您也可以以程式設計方式設定 ProfileServiceManager 物件。 服務會在頁面 PreRender 的生命週期階段期間向 ScriptManager 控制項註冊。

適用於