repeater eval problem

Discussion in 'ASP .Net' started by André Freitas, Jan 13, 2010.

  1. I got a repeater like this:

    <asp:Repeater id="ParentRepeater" runat="server"
    OnItemDataBound="OnItemDataBound">
    <HeaderTemplate>
    <ul>
    </HeaderTemplate>
    <FooterTemplate>
    </ul>
    </FooterTemplate>
    <ItemTemplate>
    <li><b><%# Eval("imagem") %></b></li>
    </ItemTemplate>
    </asp:Repeater>

    The designers will work the css and html page, its why im hoping for
    something like this:

    <ItemTemplate>
    <li><b> <asp:label ???> </b></li>
    </ItemTemplate>

    Without any .net code in aspx page. How can i put the corret value in the
    label?

    Regards,
    André
     
    André Freitas, Jan 13, 2010
    #1
    1. Advertising

  2. Yes, im using:

    rptParent.DataSource = obj;
    rptParent.DataBind();

    And i do like the aspx page without any cs code (eval). Is it possible to be
    done in the .cs page?

    Sorry about poor english.
    André


    "Mark Rae [MVP]" <> escreveu na mensagem
    news:...
    > "André Freitas" <andrefreitas> wrote in message
    > news:...
    >
    >> Without any .net code in aspx page.

    >
    > What does that actually mean?
    >
    > Are you trying to use a Repeater without any server-side code to bind the
    > data to it?
    >
    > Are you using one of the DataSource controls...?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    André Freitas, Jan 14, 2010
    #2
    1. Advertising

  3. <asp:Repeater id="ParentRepeater" runat="server"
    OnItemDataBound="OnItemDataBound">
    <HeaderTemplate>
    <ul>
    </HeaderTemplate>
    <FooterTemplate>
    </ul>
    </FooterTemplate>
    <ItemTemplate>
    <li>###</li>
    </ItemTemplate>
    </asp:Repeater>

    I dont want to bind it using eval in the aspx page. I do prefer to inject
    the correct value using some code (?) in the .cs page. Is it possible? Is it
    possible to bind without using the default way, the eval line?

    Thx anyway,
    Regards,
    André


    "Mark Rae [MVP]" <> escreveu na mensagem
    news:...
    > "André Freitas" <andrefreitas> wrote in message
    > news:...
    >
    > [please don't top-post]
    >
    >>>> Without any .net code in aspx page.
    >>>
    >>> What does that actually mean?
    >>>
    >>> Are you trying to use a Repeater without any server-side code to bind
    >>> the data to it?
    >>>
    >>> Are you using one of the DataSource controls...?

    >>
    >> Yes, im using:
    >>
    >> rptParent.DataSource = obj;
    >> rptParent.DataBind();

    >
    > OK, so you're *not* using DataSource controls - that's fine...
    >
    > However, I'm struggling to see what the problem is... Eval is the standard
    > way of using the Repeater control. See the following MSDN article:
    > http://msdn.microsoft.com/en-us/magazine/cc163780.aspx
    >
    > The way you're doing it seems fine to me...
    >
    >
    >> And I do like the aspx page without any cs code (eval). Is it possible to
    >> be done in the .cs page?

    >
    > Typically, server-side code will reside in separate class files, though
    > you can use inline coding if you want to - it's a personal preference...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    André Freitas, Jan 15, 2010
    #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. Eric Newton
    Replies:
    3
    Views:
    9,411
    Brock Allen
    Apr 4, 2005
  2. DataBinder.Eval and Eval.

    , Jun 16, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    547
    Karl Seguin [MVP]
    Jun 16, 2006
  3. Alex van der Spek

    eval('07') works, eval('08') fails, why?

    Alex van der Spek, Jan 8, 2009, in forum: Python
    Replies:
    6
    Views:
    1,450
    Bruno Desthuilliers
    Jan 8, 2009
  4. Liang Wang
    Replies:
    8
    Views:
    133
    Ben Morrow
    Feb 2, 2008
  5. Marc Girod

    to eval or not to eval?

    Marc Girod, Apr 19, 2011, in forum: Perl Misc
    Replies:
    2
    Views:
    159
    Marc Girod
    Apr 19, 2011
Loading...

Share This Page