Redigeeri

Jagamisviis:


ImageButton.GenerateEmptyAlternateText Property

Definition

Gets or sets a value indicating whether the control generates an alternate-text attribute for an empty string value.

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

Property Value

false, indicating that the ImageButton control does not generate an alternate-text attribute when the AlternateText property is empty.

Attributes

Exceptions

An attempt was made to set this property.

Remarks

By default, the ImageButton control renders the AlternateText property using an alt attribute. When the AlternateText property is not set, the ImageButton control does not include the alt attribute to specify the alternate-text in the control rendering.

The XHTML document type definition requires the alt attribute on image controls. However, accessibility best practices recommend that image controls that do not convey information relevant to the context of the Web page should not specify an alt attribute. You can meet both XHTML and accessibility requirements by setting the AlternateText property to true.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

Applies to

See also