Tab

ASPxImageBase.AlternateText Property

Gets or sets the alternate text displayed instead of the image when the image is unavailable.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

[DefaultValue("")]
public string AlternateText { get; set; }

Property Value

Type Default Description
String

String.Empty

A String value that specifies the alternate text displayed instead of the image.

Remarks

This property is a wrapper of the ImageEditPropertiesBase.AlternateText property.

Example

The complete sample project is available in the DevExpress Code Central database at E36.

<script runat="server">
     protected void Page_Load(object sender, EventArgs e) {

     }
     protected void ASPxCallback1_Callback(object source, 
         DevExpress.Web.CallbackEventArgs e) {
         string xpath = string.Format("//items/item[@id='{0}']", e.Parameter);
         XmlNode node = XmlDataSource2.GetXmlDocument().SelectSingleNode(xpath);
         if(node != null) {
             LargeImage.ImageUrl = "Images/" + node.Attributes["FileName"].Value;
             LargeImage.AlternateText = node.Attributes["Text"].Value;
             LargeImageText.Text = node.Attributes["Text"].Value; 
         }
         e.Result = ASPxCallback.GetRenderResult(ImagePanel);
     }
</script>

...
<asp:Panel ID="Panel1" runat="server" EnableViewState="false" Visible="false">
             <asp:Panel ID="ImagePanel" runat="server" >
                             <dxe:ASPxImage ID="LargeImage" runat="server" 
                             Height="240px" Width="320px">
                             </dxe:ASPxImage><br/>
                 <dxe:ASPxLabel ID="LargeImageText" runat="server" Text="">
                 </dxe:ASPxLabel>
             </asp:Panel>
</asp:Panel>        
...
See Also