repeater eval problem


A

André Freitas

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é
 
Ad

Advertisements

A

André Freitas

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é
 
Ad

Advertisements

A

André Freitas

<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 said:
"André Freitas" <andrefreitas> wrote in message

[please don't top-post]
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...
 

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

Top