Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

AltText is not displayed in Image (Web forms)

$
0
0

Here is my ImageMedia.cs file which inherits ImageData

public class ImageMedia : ImageData
{
public virtual string AltText { get; set; }
public virtual string TitleText { get; set; }
}

And it is displaying in the editmode as follows,

I have made a ContentReference as like below in the block

[CultureSpecific]
        [Required]
        [UIHint(UIHint.Image)]
        [Display(
            Name = "Image",
            GroupName = SystemTabNames.Content,
            Order = 40)]
        public virtual ContentReference Image { get; set; }

However, when I used to show that in the view (Web Forms), it is just displaying the image. Without having any Alt text or Title.

I have accessed that image like below in the view,

<EPiServer:Property runat="server" PropertyName="Image" CssClass="imageCls"></EPiServer:Property>

When it is rendered in view, the code looks like this,

<img title="true" class="imageCls" src="/globalassets/elephant.jpg" style="border-width:0px;">

How can I show the AltText and the TitleText as "alt" and "title" in the finally rendered view?

Thanks in advance :)

I am having,
EPiServer.CMS.Core version=11.11.0
EPiServer.CMS.UI version=11.14.0
EPiServer.CMS.UI.Core version=11.14.0


Viewing all articles
Browse latest Browse all 6894

Trending Articles