Binding data to object and its nested object (ASP.NET 2.0)

P

Piotrek

Hi all.

I have a web app, in which I have object A. Object A has some
properties plus it holds instance of object B.

I bound object A to FormView - all its properties are properly
displayed. However there is a problem with displaying properties of
object B. Is there some way to bind labels to ObjectA.ObjectB.Property?
Or do I have to make another FormView?

Thanks in advance,
Piotrek.
 
G

Guest

Hi
in the label's text set the value as
'<%=DataBinder.Eval(CType(CType(Container, DataListItem).DataItem,
ObjectA).ObjectB, "ObjectB_Property")%>'
--
 
P

Piotrek

Hi, thanks for answers.

I know that Eval works. However I need 2-way databinding and Eval is
designed for 1-way.

Piotrek.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top