ImageButton.GenerateEmptyAlternateText 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,指出控制項是否為空字串值產生替代文字屬性。
public:
virtual property bool GenerateEmptyAlternateText { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.Themeable(false)]
public override bool GenerateEmptyAlternateText { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.Themeable(false)>]
member this.GenerateEmptyAlternateText : bool with get, set
Public Overrides Property GenerateEmptyAlternateText As Boolean
屬性值
false
,表示 ImageButton 控制項並未在 AlternateText 屬性 (Property) 為空時,產生替代文字屬性 (Attribute)。
- 屬性
例外狀況
嘗試設定此屬性。
備註
根據預設, ImageButton 控制項會使用 alt
屬性來轉譯 AlternateText 屬性。 AlternateText如果未設定屬性, ImageButton 控制項就不會包含 alt
屬性,以在控制項轉譯中指定替代文字。
XHTML 檔案類型定義需要 alt
影像控制項上的 屬性。 不過,協助工具最佳做法建議不會傳達網頁內容相關資訊的影像控制項不應指定 alt
屬性。 您可以將 屬性設定 AlternateText 為 true
,以符合 XHTML 和協助工具需求。
這個屬性無法由佈景主題或樣式表主題設定。 如需詳細資訊,請參閱 ThemeableAttribute 和ASP.NET 主題和麵板。