ImportCatalogPart.Title 属性
定义
获取或设置在 ImportCatalogPart 控件的标题栏中显示的标题。Gets or sets the title that appears in the title bar of an ImportCatalogPart control.
public:
virtual property System::String ^ Title { System::String ^ get(); void set(System::String ^ value); };
public override string Title { get; set; }
member this.Title : string with get, set
Public Overrides Property Title As String
属性值
用作控件标题的字符串。A string that is used as the title of the control. 默认值是 Web 部件控件集提供的、计算出的控件名称。The default value is a calculated control name supplied by the Web Parts control set.
示例
下面的代码示例演示如何以声明方式 Title 和编程方式使用属性。The following code example demonstrates how to use the Title 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.
在下面的代码部分中,请注意,将以 Title 声明方式为控件设置属性值。In the following section of code, notice that the Title 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>
在此代码段中, Title 属性值以编程方式分配。In this section of code, the Title 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 中多个属性的文本,包括 Title 属性文本。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 Title property.
注解
Title ImportCatalogPart 当控件在目录模式中可见时,属性值显示在控件的标题栏中。The Title property value is displayed in the title bar of an ImportCatalogPart control when the control is visible in catalog mode. 在页面中声明控件时,可以使用属性设置属性的值 Title 。When the control is declared in a page, you can set a value for the property by using the Title attribute. 如果未提供标题的值,则使用特定于区域性的默认值描述此控件允许用户编辑的属性类型。If you do not supply a value for the title, a culture-specific default value is used to describe the kind of properties that this control allows users to edit.