Latest web development tutorials

ASP.NET Image AlternateText property

Image Control Image Control

Definition and Usage

AlternateText property sets or returns the alternate text of the image.

This attribute specifies if the image is not available, the text to display.

In the case of a browser (Internet Explorer) support, alternative text will be displayed as a tool tip.

grammar

<asp:Image AlternateText="text" runat="server" />
属性 描述
text 为图像规定替代文本。


Examples

The following examples set AlternateText property to Image control (image file does not exist):

<form runat="server">
<asp:Image id="Img1" ImageUrl="missing_img.gif"
runat="server" AlternateText="Image Text" />
</form>

The demonstration >>

Image Control Image Control