how to bind a repeater with an arraylist

  • Thread starter Thread starter psycho
  • Start date Start date
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 .
 
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.
 
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
 
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
 
Back
Top