ImageButton.GenerateEmptyAlternateText Property

Note: This property is new in the .NET Framework version 2.0.

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)

[ThemeableAttribute(false)] 
public:
virtual property bool GenerateEmptyAlternateText {
	bool get () override;
	void set (bool value) override;
}
/** @property */
public boolean get_GenerateEmptyAlternateText ()

/** @property */
public void set_GenerateEmptyAlternateText (boolean value)

public override function get GenerateEmptyAlternateText () : boolean

public override function set GenerateEmptyAlternateText (value : boolean)

Property Value

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

Exception typeCondition

NotSupportedException

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 controls should not specify empty alternate-text attributes. You can meet both XHTML and accessibility requirements by setting the AlternateText property to a string describing the image; this generates an alt attribute for the control and sets the attribute to a meaningful value.

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

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: