ImportCatalogPart.Title 屬性

定義

取得或設定顯示在 ImportCatalogPart 控制項標題列中的標題。

public:
 virtual property System::String ^ Title { System::String ^ get(); void set(System::String ^ value); };
public override string Title { get; set; }
member this.Title : string with get, set
Public Overrides Property Title As String

屬性值

做為控制項標題的字串。 預設值是 Web 組件控制項集合所提供的計算控制項名稱。

範例

下列程式碼範例示範如何以宣告方式和程式設計方式使用 Title 屬性。 如需執行範例所需的完整程式碼和指示,請參閱類別概觀的 ImportCatalogPart 一節。

在下列程式碼區段中,請注意 Title ,屬性值是以宣告方式設定控制項。

<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:ImportCatalogPart ID="ImportCatalogPart1" 
      runat="server" 
      Title="My ImportCatalogPart" 
      OnPreRender="ImportCatalogPart1_PreRender"
      BrowseHelpText="Type a path or browse to find a control's 
        description file." 
      UploadButtonText="Upload Description File" 
      UploadHelpText="Click the button to upload the description 
        file."
      ImportedPartLabelText="My User Information WebPart" 
      PartImportErrorLabelText="An error occurred while trying 
        to import a description file."  />
  </ZoneTemplate>
</asp:CatalogZone>
<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:ImportCatalogPart ID="ImportCatalogPart1" 
      runat="server" 
      Title="My ImportCatalogPart" 
      OnPreRender="ImportCatalogPart1_PreRender"
      BrowseHelpText="Type a path or browse to find a control's 
        description file." 
      UploadButtonText="Upload Description File" 
      UploadHelpText="Click the button to upload the description 
        file."
      ImportedPartLabelText="My User Information WebPart" 
      PartImportErrorLabelText="An error occurred while trying 
        to import a description file."  />
  </ZoneTemplate>
</asp:CatalogZone>

在程式碼的這個區段中, Title 會以程式設計方式指派屬性值。

protected void Button1_Click(object sender, EventArgs e)
{
  ImportCatalogPart1.Title = "Import Server Controls";
  ImportCatalogPart1.BrowseHelpText = "Enter the path to a "
    + "description file.";
  ImportCatalogPart1.UploadButtonText = "Upload Description";
  ImportCatalogPart1.UploadHelpText = "Upload a description file.";
  ImportCatalogPart1.ImportedPartLabelText = "Imported Controls";
  ImportCatalogPart1.PartImportErrorLabelText = "An error occurred " 
    + "during the import process.";

}
Protected Sub Button1_Click(ByVal sender As Object, _
  ByVal e As EventArgs)
    ImportCatalogPart1.Title = "Import Server Controls"
    ImportCatalogPart1.BrowseHelpText = "Enter the path to a " _
      & "description file."
    ImportCatalogPart1.UploadButtonText = "Upload Description"
    ImportCatalogPart1.UploadHelpText = "Upload a description file."
    ImportCatalogPart1.ImportedPartLabelText = "Imported Controls"
    ImportCatalogPart1.PartImportErrorLabelText = "An error occurred " _
      & "during the import process."
End Sub

當您在瀏覽器中載入頁面時,可以使用 [ 顯示模式 ] 下拉式清單控制項來選取 [目錄模式 ],並將頁面切換為目錄模式。 在目錄模式中的頁面和上傳的描述檔案時,請注意使用者介面中顯示的各種文字字串, (UI) 控制項 ImportCatalogPart 。 如果您按一下 [ 上傳描述檔案 ] 按鈕,UI 中數個屬性的文字會變更,包括屬性的 Title 文字。

備註

Title當控制項在目錄模式中顯示時,屬性值會顯示在控制項的 ImportCatalogPart 標題列中。 在頁面中宣告控制項時,您可以使用 屬性來設定 屬性 Title 的值。 如果您未提供標題的值,則會使用特定文化特性的預設值來描述此控制項允許使用者編輯的屬性種類。

適用於

另請參閱