PC Review


Reply
Thread Tools Rate Thread

how to bind a repeater with an arraylist

 
 
psycho
Guest
Posts: n/a
 
      3rd Jan 2008
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 .

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      3rd Jan 2008
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/egoldin
http://usableasp.net


"psycho" <(E-Mail Removed)> wrote in message
news:d3472f2d-69ef-4ee1-9b62-(E-Mail Removed)...
>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 .
>



 
Reply With Quote
 
psycho
Guest
Posts: n/a
 
      3rd Jan 2008
On Jan 3, 3:39 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.org> wrote:
> 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
>
> "psycho" <paramvir.d...@gmail.com> wrote in message
>
> news:d3472f2d-69ef-4ee1-9b62-(E-Mail Removed)...
>
> >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.
 
Reply With Quote
 
marss
Guest
Posts: n/a
 
      3rd Jan 2008
On 3 Січ, 12:55, psycho <paramvir.d...@gmail.com> wrote:

> 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
 
Reply With Quote
 
psycho
Guest
Posts: n/a
 
      3rd Jan 2008
On Jan 3, 5:14 pm, marss <marss...@gmail.com> wrote:
> On 3 Січ, 12:55, psycho <paramvir.d...@gmail.com> wrote:
>
> > 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,
> Mykolahttp://marss.co.ua


it worked.
thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using ArrayList & Repeater =?Utf-8?B?d3J5dGF0?= Microsoft ASP .NET 1 17th May 2005 12:02 PM
bind dataset to arraylist Grant Microsoft ASP .NET 0 21st Jun 2004 05:04 PM
repeater - arraylist Simon Gorski Microsoft ASP .NET 0 20th Jan 2004 09:55 AM
How do I bind a repeater? timmso Microsoft ASP .NET 2 1st Dec 2003 03:56 PM
Re: Bind an ArrayList to a Repeater Kevin Etchison Microsoft ASP .NET 0 24th Jul 2003 05:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 AM.