ImportCatalogPart.UploadHelpText 屬性

定義

取得或設定訊息文字,告訴使用者如何上載描述檔。

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

屬性值

用來做為使用者上載描述檔之指示的字串。 預設值是 Web 組件控制集所提供的文化特性字串。

範例

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

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

<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>

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

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 中數個屬性的文字會變更,包括屬性的 UploadHelpText 文字。

備註

屬性 UploadHelpText 會為使用者提供簡短的句子或指示片語,告訴他們按一下按鈕以上傳描述檔案。 如果您將自訂文字指派給這個屬性,或指派給 UploadButtonText 屬性,文字應該清楚指出使用者正在上傳描述檔。 文字不應該說或表示上傳程式實際上是上傳控制項本身。

適用於

另請參閱