ImportCatalogPart.PartImportErrorLabelText Właściwość

Definicja

Pobiera lub ustawia komunikat o błędzie wyświetlany w przypadku wystąpienia błędu podczas procesu importowania.

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

Wartość właściwości

Ciąg zawierający tekst etykiety. Wartość domyślna to komunikat specyficzny dla kultury dostarczony przez .NET Framework.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać PartImportErrorLabelText właściwości deklaratywnie i programowo. Pełny kod i instrukcje wymagane do uruchomienia przykładu można znaleźć w sekcji Przykład w przeglądzie ImportCatalogPart klasy.

W poniższej sekcji kodu zwróć uwagę, że PartImportErrorLabelText wartość właściwości jest ustawiana deklaratywnie dla kontrolki.

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

W tej sekcji kodu PartImportErrorLabelText wartość właściwości jest przypisywana programowo.

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

Po załadowaniu strony w przeglądarce możesz użyć kontrolki listy rozwijanej Tryb wyświetlania , aby wybrać pozycję Tryb wykazu i przełączyć stronę do trybu wykazu. Po przekazaniu strony w trybie wykazu i pliku opisu zwróć uwagę na różne ciągi tekstowe wyświetlane w interfejsie użytkownika (UI) dla kontrolki ImportCatalogPart . Po kliknięciu przycisku Przekaż plik opisu tekst kilku właściwości w interfejsie użytkownika zostanie zmieniony, w tym tekst właściwości PartImportErrorLabelText .

Uwagi

Właściwość jest przydatna PartImportErrorLabelText do powiadamiania użytkownika, jeśli wystąpi jakiś problem lub błąd podczas próby zaimportowania pliku opisu na stronie.

Dotyczy

Zobacz też