Partager via


ImportCatalogPart.ImportedPartLabelText Propriété

Définition

Obtient ou définit le texte affiché lorsqu'un utilisateur importe un fichier de description pour représenter ou décrire le contrôle importé dans le catalogue de contrôles importés.

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

Valeur de propriété

String

Chaîne qui contient le texte de l'étiquette. La valeur par défaut est un message propre à la culture fourni par le .NET Framework.

Exemples

L’exemple de code suivant montre comment utiliser la ImportedPartLabelText propriété de manière déclarative et programmatique. Pour obtenir le code complet et les instructions requises pour exécuter l’exemple, consultez la section Example de la vue d’ensemble de la ImportCatalogPart classe.

Dans la section de code suivante, notez que la ImportedPartLabelText valeur de propriété est définie de manière déclarative pour le contrôle.

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

Dans cette section de code, la ImportedPartLabelText valeur de propriété est affectée par programme.

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

Lorsque vous chargez la page dans un navigateur, vous pouvez utiliser le contrôle de liste déroulante Mode d’affichage pour sélectionner le mode catalogue et basculer la page en mode catalogue. Avec la page en mode catalogue et le fichier de description chargé, notez les différentes chaînes de texte affichées dans l’interface utilisateur du ImportCatalogPart contrôle. Si vous cliquez sur le bouton Télécharger Fichier de description, le texte de plusieurs propriétés de l’interface utilisateur est modifié, y compris le texte de la ImportedPartLabelText propriété.

Remarques

La ImportedPartLabelText propriété est généralement utilisée pour contenir une étiquette générale courte qui décrit le contrôle contenu dans le ImportCatalogPart contrôle.

S’applique à

Voir aussi