Add a new row dynamically to a table

Discussion in 'ASP .Net' started by Henke, Apr 18, 2004.

  1. Henke

    Henke Guest

    Hello,

    I have created a dynamic webcontrol table with several rows. I also have a
    ImageButton which
    adds a new row to the table. After I have added a new row, and I click the
    ImageButton again
    I get: "Multiple controls with id '_ctl0' was found ..."

    This is what I have done:

    page_init:

    Check if the table is persisted in a Session variable, if it is then
    add it to a placeholder control.

    page_load:

    If not postback then get the data and render the table and save it
    to a Session variable. The Session variable is used in the page_init method
    to re-create the dynamic table

    I always initialize the imagebutton and adds the eventhandler for the
    ImageBtton_onClick.

    The error message appers after the page_init method has executed.

    I donĀ“t set any ID on the controls in the cells or rows. I let ASP.NET
    handle that for me.

    Can someone give me any pointers or hints what might be wrong ?

    Regards,

    // Henke
     
    Henke, Apr 18, 2004
    #1
    1. Advertisements

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. Henke
    Replies:
    1
    Views:
    576
  2. =?Utf-8?B?U3VyZXNo?=
    Replies:
    1
    Views:
    597
    Saravana
    Nov 22, 2004
  3. loga123
    Replies:
    1
    Views:
    4,848
    ort11
    Oct 3, 2006
  4. phl
    Replies:
    1
    Views:
    4,703
    Martin Jay
    Jun 8, 2006
  5. AliR \(VC++ MVP\)

    Dynamically add row to a table

    AliR \(VC++ MVP\), Aug 16, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    886
    Alexey Smirnov
    Aug 27, 2007
  6. Paul
    Replies:
    1
    Views:
    2,871
    Hermit Dave
    Jul 11, 2008
  7. cool2005

    dynamically add a table row with onclick

    cool2005, May 8, 2005, in forum: Javascript
    Replies:
    8
    Views:
    332
    Richard Cornford
    May 9, 2005
  8. Replies:
    6
    Views:
    368
    Dr John Stockton
    Mar 19, 2006
Loading...