How to init a Table control AFTER event handling?

L

LH

Hi,

i'd like to dynamically build up a Table control after
handling a button's click event. My html table looks like:

| ID1 | DATA1 | DATA2 | Button1
| ID2 | DATA3 | DATA4 | Button2

I don't know the number of items (come from the database
dynamically). I build a table control
(System.Web.UI.WebControls.Table) in Page_Load function
(using TableRow, TableCell, Button classes).

My question: what is the generally used method to avoid
the 2 table initialization (1 during the Page_Load to init
the control and 1 during Button1_Click to update the
table's data)?. So it would be great if i could init and
create the Table control only AFTER handling the Click
event of Button1 because Button1 changes DATA1 of the
table. Of course within the same aspx (postback), i don't
want to use redirect.

In the old ASP i handled the required actions first(update
the database) and after that i build the page (based on
the updated rows).

Thanks in advance!!
LH
 

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,811
Messages
2,569,693
Members
45,477
Latest member
IsidroSeli

Latest Threads

Top