R
rockdale
I have a page that doing editing for 2 things, add/edit a group and
then populate the member list for this group.
the member list is a user control that can add new member in or edit
existing member info.
Currently, whenever the user click a delete/save button, I will
postbace and write the changes back to database and then refresh the
memberlist using the data retrieved from database.
As I review this code now, I think the member list hit database too
much, everytime user add/remove/change the member, I need to do a trip
(update and retrieve) to database.
I am thinking of save the changes to database only when the user click
the save button outside member list. That is save member list changes
and group info changes only when the user click the outside save
button.
So I need to store the member list changes in somewhere and persist
between multiple postback of this page. the member list data source is
dataset (I can change to ObjectDataSource if needed), everytime user
click save/delete button inside this member list, I will remove/add /
change my dataset.
And finally, when they want to save group info and member list , I
will loop through this dataset and write back to database.
To persist the dataset between these page postback, I am thinking
using viewstate, is this a right way to do it, ot is there a "hidden
automatic way " that asp.net done that for me already?
sorry for the long post and thanks in advance
-rockdale
then populate the member list for this group.
the member list is a user control that can add new member in or edit
existing member info.
Currently, whenever the user click a delete/save button, I will
postbace and write the changes back to database and then refresh the
memberlist using the data retrieved from database.
As I review this code now, I think the member list hit database too
much, everytime user add/remove/change the member, I need to do a trip
(update and retrieve) to database.
I am thinking of save the changes to database only when the user click
the save button outside member list. That is save member list changes
and group info changes only when the user click the outside save
button.
So I need to store the member list changes in somewhere and persist
between multiple postback of this page. the member list data source is
dataset (I can change to ObjectDataSource if needed), everytime user
click save/delete button inside this member list, I will remove/add /
change my dataset.
And finally, when they want to save group info and member list , I
will loop through this dataset and write back to database.
To persist the dataset between these page postback, I am thinking
using viewstate, is this a right way to do it, ot is there a "hidden
automatic way " that asp.net done that for me already?
sorry for the long post and thanks in advance
-rockdale