Export (0) Print
Expand All

ImportCatalogPart.UploadButtonText Property

Gets or sets the text for the Button control that initiates the upload of a description file.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

public string UploadButtonText { get; set; }
<asp:ImportCatalogPart UploadButtonText="String" />

Property Value

Type: System.String
A string that is used as the text for a Button. The default value is a culture-specific string supplied by the Web Parts control set.

The UploadButtonText property provides the text for the Button control that initiates the upload process. If you assign custom text to this property, or to the UploadHelpText property, the text should make clear that the user is uploading a description file. The text should not say or imply that the upload process is actually uploading the control itself.

The following code example demonstrates how to use the UploadButtonText property declaratively and programmatically. For the full code and instructions required to run the example, see the Example section of the ImportCatalogPart class overview.

In the following section of code, notice that the UploadButtonText 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>

In this section of code, the UploadButtonText 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 occured " 
    + "during the import process.";

}

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. 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. 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 UploadButtonText property.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft