Skip to main content

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.v22.1.dll


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.


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


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);

<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:ASPxLabel ID="LargeImageText" runat="server" Text="">
See Also