I know, it sounds strange, and I'm sure it's because I don't understand postbacks as well as I should. Here's the deal: I have a survey I've been working on that's completely db-generated; I'm just reloading one page with new data after they complete a section. The submit button's onclick event goes through the controls, pulls out the data and writes it, and then I use response.redirect to refresh the page with the new section ID.
If I leave this in Page_Load:
the page goes to the next section but it does not write anything to the db. If I comment out the postback condition, it writes the data TWICE to the db & then goes to the next section.
What am I doing wrong?
Thanks!
tigerjade
"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding
If I leave this in Page_Load:
Code:
if (!IsPostBack)
{
BindData();
}
the page goes to the next section but it does not write anything to the db. If I comment out the postback condition, it writes the data TWICE to the db & then goes to the next section.
What am I doing wrong?
Thanks!
tigerjade
"Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live." -- Martin Golding