Problems in Composite Custom Control

Discussion in 'ASP .Net Building Controls' started by Sivaji, Nov 4, 2005.

  1. Sivaji

    Sivaji Guest

    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
    Sivaji, Nov 4, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    718
  2. sleigh
    Replies:
    1
    Views:
    2,686
    sleigh
    Feb 12, 2004
  3. Frédéric Mayot

    Composite control with custom control

    Frédéric Mayot, Jul 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    342
    Frédéric Mayot
    Jul 27, 2004
  4. Replies:
    1
    Views:
    374
    Teemu Keiski
    Jul 2, 2003
  5. Chad
    Replies:
    0
    Views:
    221
Loading...

Share This Page