Compartir a través de


ImportCatalogPart.ImportedPartLabelText Propiedad

Definición

Obtiene o establece el texto que se muestra después de que un usuario importe un archivo de descripción para representar o describir el control importado dentro del catálogo de controles importados.

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

Valor de propiedad

Una cadena que contiene el texto de la etiqueta. El valor predeterminado es un mensaje específico de la referencia cultural suministrado por .NET Framework.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar la ImportedPartLabelText propiedad mediante declaración y mediante programación. Para obtener el código completo e instrucciones necesarias para ejecutar el ejemplo, consulte la sección Ejemplo de la información general de la ImportCatalogPart clase.

En la siguiente sección de código, observe que el valor de propiedad ImportedPartLabelText se establece declarativamente para el 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>

En esta sección de código, el valor de la ImportedPartLabelText propiedad se asigna mediante programación.

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

Al cargar la página en un explorador, puede usar el control de lista desplegable Modo de visualización para seleccionar Modo de catálogo y cambiar la página al modo de catálogo. Con la página en modo de catálogo y el archivo de descripción cargado, observe las distintas cadenas de texto que se muestran en la interfaz de usuario (UI) del ImportCatalogPart control. Si hace clic en el botón Cargar archivo de descripción , se cambia el texto de varias de las propiedades de la interfaz de usuario, incluido el texto de la ImportedPartLabelText propiedad .

Comentarios

Normalmente, la ImportedPartLabelText propiedad se usa para contener una etiqueta corta y general que describe el control contenido en el ImportCatalogPart control.

Se aplica a

Consulte también