Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeater databinder.eval double quotes

Tags:

c#

databinder

I have a repeater like the following,

<asp:Repeater ID="rptEntries" runat="server">                         
    <ItemTemplate>
         <asp:LinkButton ID="lnk1" runat="server" Text=""></asp:LinkButton>
    </ItemTemplate>
</asp:Repeater>

Now, I want to bind the Text value of LinkButtons with the following,

<%# DataBinder.Eval(Container.DataItem, "EntryText") %>

However, I get the double quotes problems, when I do the following,

Text="<%# DataBinder.Eval(Container.DataItem, "EntryText") %>"

How to solve this issue?

like image 864
Sait Avatar asked Jan 14 '23 15:01

Sait


1 Answers

Use a combination of double and single quotes:

Text='<%# DataBinder.Eval(Container.DataItem, "EntryText") %>'
like image 189
Curtis Avatar answered Jan 17 '23 12:01

Curtis