Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Postbacks
Message
De
05/08/2004 11:53:10
 
 
À
04/08/2004 19:44:08
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00930853
Message ID:
00931056
Vues:
15
>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
Fil
Voir

Click here to load this message in the networking platform