ImportCatalogPart.UploadButtonText 属性
定义
public:
property System::String ^ UploadButtonText { System::String ^ get(); void set(System::String ^ value); };
public string UploadButtonText { get; set; }
member this.UploadButtonText : string with get, set
Public Property UploadButtonText As String
属性值
用作 Button 的文本的字符串。A string that is used as the text for a Button. 该默认值是一个由 Web 部件控件集提供的、特定于区域性的字符串。The default value is a culture-specific string supplied by the Web Parts control set.
示例
下面的代码示例演示如何以声明方式 UploadButtonText 和编程方式使用属性。The following code example demonstrates how to use the UploadButtonText property declaratively and programmatically. 有关运行此示例所需的完整代码和说明,请参阅类概述的 "示例" 部分 ImportCatalogPart 。For the full code and instructions required to run the example, see the Example section of the ImportCatalogPart class overview.
在下面的代码部分中,请注意,将以 UploadButtonText 声明方式为控件设置属性值。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>
<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>
在此代码段中, UploadButtonText 属性值以编程方式分配。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 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. 在目录模式下页面和上传说明文件时,请注意在用户界面中显示的各种文本字符串 (UI) ImportCatalogPart 控件。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. 如果单击 " 上传说明文件 " 按钮,则会更改 UI 中多个属性的文本,包括 UploadButtonText 属性文本。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.
注解
UploadButtonText属性为 Button 启动上载过程的控件提供文本。The UploadButtonText property provides the text for the Button control that initiates the upload process. 如果为此属性分配自定义文本,或将其分配给 UploadHelpText 属性,则文本应清楚地表明用户正在上传说明文件。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.