>All,
>
> I have a webform that allows the user to check off items and save them to a table. I am using a CheckListBox to do this and it's bound to a datatable in my dataset. The problem I am having is that when there is a postback triggered by the user clicking a save button I lose all records in the datatable which causes the checklistbox to be bound to nothing. Is there a way to prevent this from occurring? The viewstate of the control is set to true.
The viewstate data only holds the info in the controls. Unless you put your dataset into viewstate (yuck) or cache it in session (amost as yuck) The fact that the web is stateless means there is nothing keeping your dataset around between postbacks.
My preference would be for you to repopulate the dataset on save, update it with the info in the control, then update it to the database.
Think of the overhead of storing all these datasets in session if you have 1000 or 10,000 users on this page.
BOb
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement