Tab
A newer version of this page is available. Switch to the current version.

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.v18.2.dll

Declaration

[DefaultValue("")]
public string AlternateText { get; set; }
<DefaultValue("")>
Public Property AlternateText As String

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.

Examples

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