G
Guest
I have a form containing three AJAX UpdatePanels, two of which contain a pair
of listboxes and a pair of buttons, with the third one containing a pair of
radio buttons in a radiobutton list and either three CascadingDropDown lists
or two CascadingDropDown lists and a textbox depending on which radio button
is selected. The only other control on my form is a button to submit the
information on the form to the server.
One thing I've noticed is the information gets posted back to the server
twice when the button is clicked. This causes a duplicate record to be
written to two tables and a SQL exception being thrown when it tries to write
a duplicate record to a third table since it violates that table's primary
key constraint. At first, I thought the cause might've been due to having
the submit button in the third UpdatePanel I mentioned, so I removed it from
the UpdatePanel and placed it by itself ... but the problem still occurs.
One other thing I've noticed is that when data for one of the UpdatePanels is
to be updated via a postback to the server, the other two UpdatePanels act as
if they're also being posted back to the server; in other words, all three
panels noticeably flicker simultaneously. I have a sneaking suspicion this
may somehow tie into my entire page being posted back twice when the submit
button is clicked, but I'm not at all sure.
What can I do to prevent my page from being posted back twice?
of listboxes and a pair of buttons, with the third one containing a pair of
radio buttons in a radiobutton list and either three CascadingDropDown lists
or two CascadingDropDown lists and a textbox depending on which radio button
is selected. The only other control on my form is a button to submit the
information on the form to the server.
One thing I've noticed is the information gets posted back to the server
twice when the button is clicked. This causes a duplicate record to be
written to two tables and a SQL exception being thrown when it tries to write
a duplicate record to a third table since it violates that table's primary
key constraint. At first, I thought the cause might've been due to having
the submit button in the third UpdatePanel I mentioned, so I removed it from
the UpdatePanel and placed it by itself ... but the problem still occurs.
One other thing I've noticed is that when data for one of the UpdatePanels is
to be updated via a postback to the server, the other two UpdatePanels act as
if they're also being posted back to the server; in other words, all three
panels noticeably flicker simultaneously. I have a sneaking suspicion this
may somehow tie into my entire page being posted back twice when the submit
button is clicked, but I'm not at all sure.
What can I do to prevent my page from being posted back twice?