Databinding to custom properties of a custom class in ASP.NET 2
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
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....
(Sorry if this isn't appopriate forum; couldn't find a specific .NET 2 forum)
|All times are GMT. The time now is 07:13 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.