ImportCatalogPart.ImportedPartLabelText Proprietà

Definizione

Ottiene o imposta il testo che viene visualizzato in seguito all'importazione di un file di descrizione per rappresentare o descrivere il controllo importato nell'apposito catalogo.

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

Valore della proprietà

String

Stringa che contiene il testo dell'etichetta. Il valore predefinito è un messaggio specifico delle impostazioni cultura fornito in .NET Framework.

Esempio

Nell'esempio di codice seguente viene illustrato come usare la ImportedPartLabelText proprietà in modo dichiarativo e a livello di codice. Per il codice completo e le istruzioni necessarie per eseguire l'esempio, vedere la sezione Esempio della panoramica della ImportCatalogPart classe.

Nella sezione di codice seguente si noti che il valore della ImportedPartLabelText proprietà viene impostato in modo dichiarativo per il controllo .

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

In questa sezione di codice il valore della ImportedPartLabelText proprietà viene assegnato a livello di codice.

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

Quando si carica la pagina in un browser, è possibile usare il controllo elenco a discesa Modalità di visualizzazione per selezionare Modalità catalogo e passare alla modalità catalogo. Con la pagina in modalità catalogo e il file di descrizione caricati, prendere nota delle varie stringhe di testo visualizzate nell'interfaccia utente per il ImportCatalogPart controllo. Se si fa clic sul pulsante Upload File descrizione, il testo per diverse proprietà nell'interfaccia utente viene modificato, incluso il testo per la ImportedPartLabelText proprietà.

Commenti

La ImportedPartLabelText proprietà viene in genere utilizzata per contenere un'etichetta breve e generale che descrive il controllo contenuto nel ImportCatalogPart controllo .

Si applica a

Vedi anche