Asp Table Problem

G

Guest

I have a asp table which I am populating dynamically server side with various
other controls such as text boxes, drop down lists and buttons. The controls
in this table are filled with data stored in a data table (if there is any).
On the first load of the page I create the datatable and set the columns up
to store the data entered into the controls within my asp table. I then have
a tablecreate method which basically checks to see if any data is held in my
datatable, and if so then render my asp table cell-by-cell, filling the
controls in accordingly. I have a button called 'remove' in the final cell of
a row in my asp table. When I dynamically create the button and add it to the
table, I assign it an event handler for the click event. The main function of
this button is to remove the given row. I planned to achieve this by removing
the row from the datatable from which the table is populated, and then
calling the tablecreate method again. The problem is that when I click on the
button, the page load method is hit first which renders my table, and then
the button event is hit, which removes the row from the datatable. So you
click remove and nothing appears to happen, but on the next postback the row
is removed. Why is the button click being hit after page load, and is there
any way I can fix this or manually tell the asp table to redraw itself?
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top