Поделиться через


ImportCatalogPart.PartImportErrorLabelText Свойство

Определение

Возвращает или задает сообщение об ошибке, отображаемое при возникновении ошибки во время процесса импорта.

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

Значение свойства

Строка, содержащая текст метки. Значение по умолчанию — это сообщение, определенное языком и региональными параметрами, предоставленное платформой .NET Framework.

Примеры

В следующем примере кода показано, как использовать PartImportErrorLabelText свойство декларативно и программно. Полный код и инструкции, необходимые для выполнения примера, см. в разделе ImportCatalogPart "Пример" обзора класса.

В следующем разделе кода обратите внимание, что PartImportErrorLabelText значение свойства задается декларативно для элемента управления.

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

В этом разделе кода PartImportErrorLabelText значение свойства назначается программным способом.

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

При загрузке страницы в браузере можно использовать раскрывающийся список " Режим отображения ", чтобы выбрать режим каталога и переключить страницу в режим каталога. С помощью страницы в режиме каталога и отправленном файле описания обратите внимание на различные текстовые строки, отображаемые в пользовательском интерфейсе элемента ImportCatalogPart управления. Если нажать кнопку "Отправить файл описания" , текст для нескольких свойств в пользовательском интерфейсе изменяется, включая текст свойства PartImportErrorLabelText .

Комментарии

Свойство PartImportErrorLabelText полезно для уведомления пользователя о возникновении какой-либо проблемы или ошибки при попытке импорта файла описания страницы.

Применяется к

См. также раздел