Editare

Partajați prin


ImportCatalogPart.BrowseHelpText Property

Definition

Gets or sets a text message that instructs users to browse to the location of a description file.

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

Property Value

A string that contains the text of the message. The default value is a culture-specific message supplied by the .NET Framework.

Examples

The following code example demonstrates how to use the BrowseHelpText 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 BrowseHelpText 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>

In this section of code, the BrowseHelpText 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

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

Remarks

The BrowseHelpText property gives users a simple overview of the first thing they must do in the process of adding an imported control: provide the location of a description file, by either typing in a path or browsing to the file. A typical reason to supply a custom value for this property is if you have special instructions for users, such as a specific network share to which they should browse to locate a description file.

Applies to

See also