🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.aspdotnet.components.using
Article #7

Re: DataList, ArrayList and DataBinder.Eval

#7
From: Marc Rohloff TeamB
Date: Wed, 08 Jun 2005 00:11
24 lines
2138 bytes
On Tue, 07 Jun 2005 11:05:32 +0200, morisse wrote:

> Hi,
> I would like to list out all files of a directory.
> To do that, I created a CFileInfo class with string members (strName, 
> strDate, strLength...) and I fill an ArrayList with those object.
> It works good, I can get an ArrayList with all CFileInfo objects that 
> contain strName, strDate, strLength...
> 
> The problem is how to show a member of an object embeded in an ArrayList?
> 
> I get an "Exception Details: System.Web.HttpException: DataBinder.Eval: 
> 'www.adm.ascx.CFileInfo' does not contain a property with the name 
> CFileInfo.
> " error for this line
> <%#DataBinder.Eval(Container.DataItem, "CFileInfo.strName")%>

You should probably just use strName not CFileInfo.strName. Your
properties need to be public, you could even set these in the designer
instead of using Eval. You could also use the built in fFile object.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <1xpqw7bdbcer2.dlg@marcrohloff.40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42a5635d$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1f001d,db170c40b81d8bac
X-Google-Attributes: gid1f001d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: DataList, ArrayList and DataBinder.Eval
Newsgroups: borland.public.csharpbuilder.aspdotnet.components.using
User-Agent: 40tude_Dialog/2.0.15.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <42a5635d$1@newsgroups.borland.com>
Date: Tue, 7 Jun 2005 20:11:44 -0400
Message-ID: <1xpqw7bdbcer2.dlg@marcrohloff.40tude.net>
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
X-Antivirus: avast! (VPS 0523-2, 06/07/2005), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 67.149.151.113
X-Trace: newsgroups.borland.com 1118189437 67.149.151.113 (7 Jun 2005 17:10:37 -0700)
Lines: 24
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail