Click to See Complete Forum and Search --> : help with submit button problem


Raif
July 29th, 2004, 10:17 AM
Hi, I have a html table with textboxes in it. underneath it has edit, update, cancel buttons. on page_load there is a if not page.ispostback statement if first load then it populates a dropdownlist. the client then chooses a customer and the page is reloaded this time a sub is run which fills a datareader from sqlserver tabel and the textboxes are populated with this. the problem is that when the textbox is edited and the update button is clicked the page_load runs the sub repopulateing the textboxes with the origional content before anything else can happen. So I put a hidden field in the on click for the edit button that sets a "1" in that field. then the on_load has an if then that if hidden field = 1 then it skips the sub. This works for the update button. but the cancel button doesn't work because before the cancel button code can change the hidden field to "0" the on_load is run which then skips the sub that returns data to origional.

it seems that I need an on event that fires before the page is reloaded so that it can chage it hidden field but I don't know how to do this. Any help would be greatly appreaciated.
Thanks
Raif