WebPartZoneBase.DisplayTitle 屬性

定義

取得目前的文字值,該值是在區域本身為可見時,用來做為 WebPartZoneBase 區域的標題。

public:
 virtual property System::String ^ DisplayTitle { System::String ^ get(); };
[System.ComponentModel.Browsable(false)]
public virtual string DisplayTitle { get; }
[<System.ComponentModel.Browsable(false)>]
member this.DisplayTitle : string
Public Overridable ReadOnly Property DisplayTitle As String

屬性值

String

字串,包含區域的標題文字。 預設值是基底 HeaderText 屬性的值。

屬性

範例

下列程式碼範例示範 控制項上 WebPartZone 屬性的 DisplayTitle 宣告式用法。 如需完整的程式碼範例,包括程式碼後置原始程式檔和包含此程式碼中區域的 .aspx 頁面,請參閱 WebPartZoneBase 類別概觀。

請注意,在下列程式碼範例中, DisplayTitle 屬性值是從部分類別擷取。

protected void Button4_Click(object sender, EventArgs e)
{
  StringBuilder builder = new StringBuilder();
  builder.AppendLine(@"<strong>WebPartZone1 DisplayTitle Property</strong><br />");
  builder.AppendLine(WebPartZone1.DisplayTitle + @"<br />");
  Label2.Text = builder.ToString();
  Label2.Visible = true;
}
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs)
  Dim builder As New StringBuilder()
  builder.AppendLine("<strong>WebPartZone1 DisplayTitle Property</strong><br />")
  builder.AppendLine(WebPartZone1.DisplayTitle + "<br />")
  Label2.Text = builder.ToString()
  Label2.Visible = True
End Sub

備註

屬性 DisplayTitle 會從基底 HeaderText 屬性取得其值,如果該值為 null ,則會 ID 使用區域的值。

適用於

另請參閱