repeater problem

R

rouqiu

Hello,
I want to set a unique id for each item in a repeater like this:

<asp:repeater id=__theTabStrip runat="server" DataSource='<%#
DataBinder.Eval(Container,"TabText") %>'>
<ItemTemplate>
<asp:Button Runat="server" id="<%# Container.DataItem %>" BackColor="<%#
SetTabBackColor(Container) %>" />
</ItemTemplate>
</asp:repeater>

However, the id="<%# Container.DataItem %>" generates an error:'<%#
Container.DataItem %>' is not a valid identifier.

Would someone please tell me what I did wrong?
 
C

Curt_C [MVP]

rouqiu said:
Hello,
I want to set a unique id for each item in a repeater like this:

<asp:repeater id=__theTabStrip runat="server" DataSource='<%#
DataBinder.Eval(Container,"TabText") %>'>
<ItemTemplate>
<asp:Button Runat="server" id="<%# Container.DataItem %>" BackColor="<%#
SetTabBackColor(Container) %>" />
</ItemTemplate>
</asp:repeater>

However, the id="<%# Container.DataItem %>" generates an error:'<%#
Container.DataItem %>' is not a valid identifier.

Would someone please tell me what I did wrong?

You may want to repost this one to a .NET (DotNet) group. This group is
for the "classic" ASP stuff, not many .NET people here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top