Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dataset
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
00722613
Message ID:
00725869
Vues:
15
>So, in my mind that isn't data binding... or is that all you get in web forms? Or, maybe he is doing this cause he is using business objects rather than dropping a SQLConneciton and SQLAdapter objects on the design surface?

Thats all you get with webforms. One way data binding. Its not a limitation of business objects. When the control is rendered, its value will display the value of its datasource. When you post back, the datasource will not be updated with the control's value, as you have seen.

There is one advantage. You can databind to an expression or method:
< % ERROR: # AnyMethodThatReturnsAString(datasource) # % >
What I do to fix it is I iterate through the form that is posted back and I compare the control id's with the datasets column names. If there are any matches, I update the dataset with the form's value. I call this round-trip databinding and it works well. You just have to remember to name your controls the same as your dataset columns.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform