how to bind a repeater with an arraylist

P

psycho

i was trying to bind a repeater with an arraylist.
what i was not able to figure out was what should i use in the
Eval("") expression.

Any suggestions .
 
P

psycho

Regular syntax, like

<td><%# Eval("ProductID") %></td>

ProductID is supposed to be a public property defined on the objects stored
in the arraylist.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net


i was trying to bind a repeater with an arraylist.
what i was not able to figure out was what should i use in the
Eval("") expression.
Any suggestions .

but i have stored only the integer values in the list.
 
M

marss

but i have stored only the integer values in the list.

Eval("SomeProperty") is a short for
DataBinder.Eval(Container.DataItem, "SomeProperty"). So, if your
arraylist contains only integers, you can bind it in the following
way:

<asp:Repeater id=Repeater1 runat="server">
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
</asp:Repeater>

Regards,
Mykola
http://marss.co.ua
 
P

psycho

Eval("SomeProperty") is a short for
DataBinder.Eval(Container.DataItem, "SomeProperty"). So, if your
arraylist contains only integers, you can bind it in the following
way:

<asp:Repeater id=Repeater1 runat="server">
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
</asp:Repeater>

Regards,
Mykolahttp://marss.co.ua

it worked.
thanks
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top