System.Web.UI.WebControls.Image.GenerateEmptyAlternateText Property

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

Syntax

[System.ComponentModel.DefaultValue(false)]
public virtual bool GenerateEmptyAlternateText { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

By default, when the Image.AlternateText property is not set, the System.Web.UI.WebControls.Image control does not include the alt attribute to specify the alternate text in the control rendering. Set the Image.GenerateEmptyAlternateText property to true to always include the alternate text attribute in rendered output for the System.Web.UI.WebControls.Image control.

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 Image.GenerateEmptyAlternateText property to true.

Requirements

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