Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataBinder.Eval

Status
Not open for further replies.

Peppi

Programmer
Joined
Apr 9, 2001
Messages
205
Location
CA
Hi,

If I have the following (simplified) classes:

Resource
---------
Fields - UserID (String), WorkItems (array of WorkItem objects)

WorkItem
---------
Fields - ID (long), Stage (String), StartDate (Date), EndDate (Date)

If I bind my repeater control to a Resource, how do I get at the details for each of the WorkItems? Is it as simple as DataBinder.Eval(Container.DataItem, "WorkItems.ID") or is it something more complex than that?

Thx.
 
If it's a collection of WorkItems, you'll actually want to bind the Repeater to that collection instead of the parent Resource class.

After that, it's a simple matter of calling:

Code:
<!-- ASP.NET 1.x -->
DataBinder.Eval(Container.DataItem, "ID")

<!-- ASP.NET 2.0 -->
Eval("ID")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top