🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.aspdotnet.components.using
2 messages
2 total messages Started by morisse Tue, 07 Jun 2005 09:05
DataList, ArrayList and DataBinder.Eval
#12
Author: morisse
Date: Tue, 07 Jun 2005 09:05
21 lines
1749 bytes
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")%>

It's not a problem to do that with a datagrid and a DB, but using an 
ArrayList is a little more difficult for me...

Any idea...

Thanks.
Re: DataList, ArrayList and DataBinder.Eval
#7
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads