Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining if property changed during postback
Message
De
03/12/2003 21:07:57
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00855573
Message ID:
00855697
Vues:
16
>I am not using datasets. Am loading data into web page controls on first pass and using viewstate between posts. I have a datagrid that I've added a checkbox that is bound to a bool value - the datagrid is loaded with a datareader. The only actionable columns are the checkbox and a link column. I want to use a button on the form to update the database if the checkbox.checked property has changed (checked/unchecked).
>
>I only want to write to the database if there is a change.
>
>Is there a way in my codebehind to know if the value of the checkbox in the grid has changed? A reference to the old and new values?
>
>I am making it work with an additional hidden column that is bound to the same field as the checkbox, but there must be a cleaner way, right?
>
>Any help greatly appreciated,
>
>~dab

Dean,

You can check the control's ViewState property to see the value that was saved during the postback.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform