0
votes

I have a repeater in which I have to set hyperlink for binding link, i tried in the below code but it is not working.

<asp:Repeater ID="rptNews" runat="server">
                <ItemTemplate>
                    <div>
                        <div class="Newsdivalign">
                            <asp:HyperLink ID="hytitle" runat="server" src='<%#Eval("title") %>' ></asp:HyperLink>
                        </div>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
1

1 Answers

0
votes

I don't think src is a valid parameter for the HyperLink control. You need to set Text for the description and NavigateURL for the URL.

Not tested, but something like this:

<asp:HyperLink ID="hytitle" runat="server" 
    Text='<%#Eval("title") %>' NavigateURL='<%#Eval("url") %>' 
</asp:HyperLink>