+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Display related media(Image) in List News template

Display related media(Image) in List News template

2 posts, 2 answered
  1. Luyen Minh
    Luyen Minh avatar
    9 posts
    Registered:
    27 Oct 2014
    09 Jan 2015
    Link to this post

    Hello Telerik team.

    I was added a new related media field(image) for News content type, In my page  I want to use News widget and edit a template for display image.

    My code in template is below:

    <asp:Image runat="server" ID="Image"  src='<%#Eval("Image")%>'  />

    But image is not display.

    Please tell me how to display image filed in template.

    Thanks.

    (p/s: I'm trying to learning English, if you don't understand, please tell me)

    Answered
  2. Luyen Minh
    Luyen Minh avatar
    9 posts
    Registered:
    27 Oct 2014
    09 Jan 2015 in reply to Luyen Minh
    Link to this post

    Here is a solution:

    <asp:Repeater runat="server" DataSource='<%# Eval("Image") %>'>
        <ItemTemplate>
            <li><a href='<%# Eval("MediaUrl") %>'>
            <img src="<%# Eval("MediaUrl")%>" alt="<%# Eval("AlternativeText")%>" id="<%# Eval("Id") %>" title="<%# Eval("Title") %>" >
                </a></li>
        </ItemTemplate>
         </asp:Repeater>

     

    it's work for me.

     

    Answered
2 posts, 2 answered