K
Kelly
Hi Everyone
I have a web application and all it basically does is ask for a user
id and show a questionnaire. To create the questionnaire, I get the
list of questions from the database and dynamically add controls
(i.e,. labels, radiobuttons, textboxes) for each question. If the user
has visited the page before, I will go to the database and populate
the questionnaire with the answers that the user have entered before
and display it to the user and allow them to edit it.
Everytime the page loads, I will recreate the dynamic controls and
populate it with that user's information from the database. However
my problem is that even if there is a different user id entered, the
values for the dynamic controls stay the same even though I just
recreated them! So if I put in User1 for the user id, a questionnaire
will show up with User1's information from the database, but if I put
in User2 next for the user id, I get a questionnaire with User1's
information on it. Does anyone know why the values for the
dynamically created controls are not being updated?
I heard that it might help to set enableviewstate to false, but I
can't do that because I use request.form to get the values from those
dynamically created controls. Thanks in advance.
Kelly
I have a web application and all it basically does is ask for a user
id and show a questionnaire. To create the questionnaire, I get the
list of questions from the database and dynamically add controls
(i.e,. labels, radiobuttons, textboxes) for each question. If the user
has visited the page before, I will go to the database and populate
the questionnaire with the answers that the user have entered before
and display it to the user and allow them to edit it.
Everytime the page loads, I will recreate the dynamic controls and
populate it with that user's information from the database. However
my problem is that even if there is a different user id entered, the
values for the dynamic controls stay the same even though I just
recreated them! So if I put in User1 for the user id, a questionnaire
will show up with User1's information from the database, but if I put
in User2 next for the user id, I get a questionnaire with User1's
information on it. Does anyone know why the values for the
dynamically created controls are not being updated?
I heard that it might help to set enableviewstate to false, but I
can't do that because I use request.form to get the values from those
dynamically created controls. Thanks in advance.
Kelly