Export (0) Print
Expand All

ImageButton.GenerateEmptyAlternateText Property

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public override bool GenerateEmptyAlternateText { get; set; }
<asp:ImageButton GenerateEmptyAlternateText="True|False" />

Property Value

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


An attempt was made to set this property.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft