ASP.NET Web Controls >> How to init a Table control AFTER event handling?

by LH » Tue, 12 Aug 2003 02:06:30 GMT

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


Similar Threads

1. Sequence Order between Page Init and User Control Init

Hello everybody,

I got a aspx which have several user controls on it. My question is that 
what is the order of ASP.NET execute the page and user control ? does it 
like this :

Page Init -> User Control Init -> Page Load -> User Control Load ?

Thx

Tony 


2. User control init event in C#

3. When control init event fired???

Put any control on web page.
create Init event for ths control.
Write Response.Write("here") inside this event.
Compile\build\run. I never saw "here" string appear on web page. Why???


4. Init event for control doesn't fire - Asp.Net

5. Oninit ( Init Event) of page / control

Hi
I was going thru a document on web page life cycle which says on page
initialization "A page's controls (and the page itself) are first
initialized in their raw form". I was trying to understand what excatly is
happening here.
Any links / documents which could give more comprehensive explantion would
be nice.

Thanks
Sourabh


6. load event doesn't fire unless init event is present - ASP.NET Web Controls

7. composite control child control event handling

Hi,

I have a composite control containing a dropdownlist control.

I want to handle the SelectedIndexChanged event of the ddl control in my
composite contol, and then raise the event SelectedIndexChanged event for
the container of my composite control.

What I am finding is that when I'm in the SelectedIndexChangedevent handler
for the ddl within my composite control, the child ddl control does not
correctly indicate the *new* selectedindex.

Can't work out why.

Any one?

Thanks
Martin


8. User Control's child control event handling