repeater problem

Discussion in 'ASP General' started by rouqiu, Jul 13, 2005.

  1. rouqiu

    rouqiu Guest

    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?

    --
    help, help
     
    rouqiu, Jul 13, 2005
    #1
    1. Advertising

  2. rouqiu

    CJM Guest

    "rouqiu" <> wrote in message
    news:...
    >
    > Would someone please tell me what I did wrong?
    >


    You posted to the *classic* ASP group rather than a dotNET one.
     
    CJM, Jul 13, 2005
    #2
    1. Advertising

  3. rouqiu

    Curt_C [MVP] Guest

    rouqiu wrote:
    > 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.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 13, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    905
  2. Replies:
    0
    Views:
    2,938
  3. Replies:
    1
    Views:
    7,070
    Karl Seguin
    Aug 10, 2005
  4. uncensored
    Replies:
    0
    Views:
    852
    uncensored
    Oct 25, 2006
  5. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    228
    Microsoft
    Aug 21, 2006
Loading...

Share This Page