Howdy,
In AP.NET 2.0 you can use Eval instead of DataBinder.Eval. In addition
remember data bound expressions for server controls must be defined in entire
attribute:
<asp:Label runat="server" Text='<%# "prefix " + Eval("whatever") %>'/>
NOT
<asp:Label runat="server" Text='prefix<%# Eval("whatever") %>'/>
Anyway:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Ptitle</title>
</head>
<body>
<form id="form1" runat="server">
<h2>
Test Repeater and templates</h2>
<asp:Repeater ID="RepeaterCollection" runat="server">
<ItemTemplate>
ItemTemplate : <%# DataBinder.Eval(Container.DataItem,
"OwnerId") %>
- <%# DataBinder.Eval(Container.DataItem, "FirstName") %>
<asp:HyperLink ID="HyperLink2" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "OwnerId") %>' />
<asp:Label ID="Label2" runat="server" Text='<%#
String.Format(DataBinder.Eval(Container.DataItem, "FirstName"), "Surrounding
{0} text" %>' />
<asp:Label ID="Label3" runat="server" Text='<%# Eval("FirstName") %>'
<br />
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
Hope it helps

Signature
Milosz
> Hello everybody,
> I need to use bound variables in a field of a web server control which
[quoted text clipped - 64 lines]
> Sincerely,
> Abargaddon
abargaddon - 02 Feb 2008 21:41 GMT
Hi Milosz,
Thank you a lot, this was indeed my problem.
However, I did not find it mentioned in the MSDN site, although it is an
important detail !
Thank you again, and have a nice sunday.
Abargaddon
Milosz Skalecki [MCAD] a écrit :
> Howdy,
>
[quoted text clipped - 33 lines]
>
> Hope it helps