HighTechTalks DotNet Forums  

repeater question

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss repeater question in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
rouqiu
 
Posts: n/a

Default repeater question - 07-13-2005 , 11:20 AM






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?

Many Thanks



--
help, help

Reply With Quote
  #2  
Old   
Cowboy (Gregory A. Beamer) - MVP
 
Posts: n/a

Default RE: repeater question - 07-14-2005 , 11:51 AM






My two cents: It is easier to set up a container and bind multiple dynamic
controls to it than it is to attempt to declaratively bind dynamic controls
to a control (like a repeater).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"rouqiu" wrote:

Quote:
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?

Many Thanks



--
help, help

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.