ImportCatalogPart.PartImportErrorLabelText Propriedade
Definição
Obtém ou define uma mensagem de erro que será exibida se ocorrer um erro durante o processo de importação.Gets or sets an error message that is displayed if an error occurs during the import process.
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
Valor da propriedade
Uma cadeia de caracteres que contém o texto do rótulo.A string that contains the text of the label. O valor padrão é uma mensagem específica de cultura fornecida pelo .NET Framework.The default value is a culture-specific message supplied by the .NET Framework.
Exemplos
O exemplo de código a seguir demonstra como usar a PartImportErrorLabelText propriedade de forma declarativa e programaticamente.The following code example demonstrates how to use the PartImportErrorLabelText property declaratively and programmatically. Para obter o código completo e as instruções necessárias para executar o exemplo, consulte a seção de exemplo da ImportCatalogPart classe visão geral.For the full code and instructions required to run the example, see the Example section of the ImportCatalogPart class overview.
Na seção de código a seguir, observe que o PartImportErrorLabelText valor da propriedade é definido declarativamente para o controle.In the following section of code, notice that the PartImportErrorLabelText property value is set declaratively for the control.
<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>
Nesta seção de código, o PartImportErrorLabelText valor da propriedade é atribuído programaticamente.In this section of code, the PartImportErrorLabelText property value is assigned programmatically.
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
Ao carregar a página em um navegador, você pode usar o controle de lista suspensa modo de exibição para selecionar o modo de catálogo e alternar a página para o modo de catálogo.When you load the page in a browser, you can use the Display Mode drop-down list control to select Catalog Mode and switch the page to catalog mode. Com a página no modo de catálogo e o arquivo de descrição carregado, observe as várias cadeias de caracteres de texto exibidas na interface do usuário para o ImportCatalogPart controle.With the page in catalog mode and the description file uploaded, note the various text strings displayed in the user interface (UI) for the ImportCatalogPart control. Se você clicar no botão carregar arquivo de descrição , o texto para várias das propriedades na interface do usuário será alterado, incluindo o texto da PartImportErrorLabelText propriedade.If you click the Upload Description File button, the text for several of the properties in the UI is changed, including the text for the PartImportErrorLabelText property.
Comentários
A PartImportErrorLabelText propriedade é útil para notificar um usuário se algum problema ou erro ocorrer enquanto a página tenta importar um arquivo de descrição.The PartImportErrorLabelText property is useful for notifying a user if some problem or error occurs while the page attempts to import a description file.