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

屬性值

字串,包含區域的標題文字。 預設值是基底 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 區域的值。

適用於

另請參閱