G
Guest
Hi there,
Can anyone tell me how to perform two-way binding with custom properties in
ASP.NET 2? Let's say I have a custom class called Person that I want to bind
to a FormView (using an ObjectDataSource) for editing . The Person class
exposes an Address property which in turn has ZipCode and City properties
(both strings).
How do I bind these to my FormView control? I tried Bind("Address.ZipCode")
but I got an error stating I should bind to properties on the Person class.
I can successfully change Bind to Eval (e.g. Eval("Address.ZipCode")) but
then I loose the ability to update my Person class automatically as changes
to the fields for the Address are not propagated back to my Person object.
Is two-way data binding even possible with custom properties?
Thanks in advance for any replies....
Imar
(Sorry if this isn't appopriate forum; couldn't find a specific .NET 2 forum)
Can anyone tell me how to perform two-way binding with custom properties in
ASP.NET 2? Let's say I have a custom class called Person that I want to bind
to a FormView (using an ObjectDataSource) for editing . The Person class
exposes an Address property which in turn has ZipCode and City properties
(both strings).
How do I bind these to my FormView control? I tried Bind("Address.ZipCode")
but I got an error stating I should bind to properties on the Person class.
I can successfully change Bind to Eval (e.g. Eval("Address.ZipCode")) but
then I loose the ability to update my Person class automatically as changes
to the fields for the Address are not propagated back to my Person object.
Is two-way data binding even possible with custom properties?
Thanks in advance for any replies....
Imar
(Sorry if this isn't appopriate forum; couldn't find a specific .NET 2 forum)