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

  • Thread starter Thread starter Piotrek
  • Start date Start date
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.
 
Hi
in the label's text set the value as
'<%=DataBinder.Eval(CType(CType(Container, DataListItem).DataItem,
ObjectA).ObjectB, "ObjectB_Property")%>'
--
 
Hi, thanks for answers.

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

Piotrek.
 
Back
Top