网摘 |  收藏 | 

AlternateText 属性

设置或返回当图像不能用于设备时显示的替换文本。默认值为空字符串 ("")。

public string AlternateText {
   get,
   set
}

备注

替换文本出现在不支持图像的浏览器中。

示例

下面的示例演示了如何使用 AlternateText属性进行显示。

private void Page_Load(object sender, System.EventArgs e)
{
   // Programmatically add an image URL.
   Image1.ImageUrl = "myimage.gif";

   // Browsers that do not support an image format
   // will show alternate text.
   Image1.AlternateText = "Image not Supported";
   Image1.NavigateUrl = "http://www.microsoft.com/china";
}  

 

posted @ 2012-11-29 10:12  xulonghua219  阅读(410)  评论(0编辑  收藏  举报