Problems in Composite Custom Control

S

Sivaji

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.

Thanks,
Sivaji
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top