Hi everybody,
I am trying to a build an ASP .Net Custom Control(in C#) which will create a
table ( with variable number of rows) dynamically based on the number of rows
provided in a textbox of the same control.After row number is specified , the
control dynamically generates the table with a textbox ( for taking the input
of the number of columns in the individual row) in each of the rows .Based on
the inputs provided in this table the same control generates a second table
with variable no of columns in each of the rows.Basically I am doing the
rendering for all the tables in CreateChildControls().Also I am using Table
server controls to draw these 2 tables.
The first problem I am facing is that i am losing the values given in the
first table once there is any kind of PostBack action in the controls. It
seems that values provided in the first table are not posted back to the
server , as textbox rendered within the each row of first table is a child
control within another child ( Table Control)control which in turn is a child
of the main control.

The second problem I am facing whatever re -rendering action I want to
achieve within CrateChildControls() after a button-generated postback, does
not seem to have occured in the first click, because CretaChildControl() is
called ( which renders based on the previous input ) first , followed by
event-handler function which actually updates the recent change in the input.
In this case I have click a button twice or write repopulation code for each
control in each event handler.

Please advise me about where I am going wrong , or what is the standard
approach for achieving this kind of functionality .Also pls comment if it
will be easier to go for client-side code as my control does not perform any
server-specific processing in these stages.