PC Review


Reply
Thread Tools Rate Thread

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

 
 
Piotrek
Guest
Posts: n/a
 
      3rd Aug 2006
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SWJyYWhpbSBTaGFtZWVxdWU=?=
Guest
Posts: n/a
 
      3rd Aug 2006
Hi
in the label's text set the value as
'<%=DataBinder.Eval(CType(CType(Container, DataListItem).DataItem,
ObjectA).ObjectB, "ObjectB_Property")%>'
--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB


"Piotrek" wrote:

> 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.
>
>

 
Reply With Quote
 
=?Utf-8?B?SWJyYWhpbSBTaGFtZWVxdWU=?=
Guest
Posts: n/a
 
      3rd Aug 2006
Have to use formview instead of datalist in the above post
--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB


"Piotrek" wrote:

> 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.
>
>

 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      3rd Aug 2006
Piotrus,
Juz dziala wszystko?
Patrick
"Piotrek" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
Piotrek
Guest
Posts: n/a
 
      4th Aug 2006
Hi, thanks for answers.

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

Piotrek.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding TextBox to Nested/Complex property - and what happens if theChild object is null? EfyT Microsoft C# .NET 1 15th Oct 2009 05:36 PM
Binding TextBox.Text to property in nested (multi levels) object withbindingsource, Error if grandchild object is NULL Efy Microsoft Dot NET 0 14th Oct 2009 11:06 AM
Data binding to an object Simon Verona Microsoft VB .NET 4 7th Jul 2006 09:16 AM
Data binding to another object Sam Martin Microsoft C# .NET 1 17th Nov 2004 02:47 PM
Data Binding to a object... Simon Verona Microsoft VB .NET 19 25th Jun 2004 09:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:52 AM.