When adding controls programmatically...

Discussion in 'ASP .Net' started by Rob Meade, May 15, 2007.

  1. Rob Meade

    Rob Meade Guest

    ...does it matter which order?

    ie...

    I create a table/tablerow/tablecell, I then create a new update panel, I
    create a drop down list, I add list items to the drop down list, I then add
    the drop down list to the update panel. The update panel is then added to a
    table cell, I then create another drop down list, and add it to the update
    panel, the table cell is then added to the row, the row to the table.

    When I run my code and look at the source the second drop down list is not
    within the <div> </div> tags, thus not in the update panel - any thoughts?

    Regards

    Rob
     
    Rob Meade, May 15, 2007
    #1
    1. Advertising

  2. On May 15, 11:23 am, "Rob Meade" <> wrote:
    > ..does it matter which order?
    >
    > ie...
    >
    > I create a table/tablerow/tablecell, I then create a new update panel, I
    > create a drop down list, I add list items to the drop down list, I then add
    > the drop down list to the update panel. The update panel is then added to a
    > table cell, I then create another drop down list, and add it to the update
    > panel, the table cell is then added to the row, the row to the table.
    >
    > When I run my code and look at the source the second drop down list is not
    > within the <div> </div> tags, thus not in the update panel - any thoughts?
    >
    > Regards
    >
    > Rob


    Do you mean that it's not shown on the page, or it is shown outside
    the panel?

    A code can help to answer.
     
    Alexey Smirnov, May 15, 2007
    #2
    1. Advertising

  3. Rob Meade

    Rob Meade Guest

    "Alexey Smirnov" wrote ...

    > Do you mean that it's not shown on the page, or it is shown outside
    > the panel?


    The drop down list in question was displayed on the page, but not in the
    updatePanel in the first table cell. I've subsequently realised where I'd
    gone wrong...

    I was adding the second drop down list to the update panel which was
    correct, but then I had another line of code which was adding the same drop
    down list to the second table cell - it would seem that rather than generate
    an error message about the same control being on the page with the same ID,
    instead it *didn't* add it to the updatePanel in favour of adding it to the
    table cell as this was the order of the code etc...

    All working now...

    Thanks for your reply Alexey.

    Regards

    Rob
     
    Rob Meade, May 15, 2007
    #3
  4. On May 15, 2:22 pm, "Rob Meade" <> wrote:
    > "Alexey Smirnov" wrote ...
    >
    > > Do you mean that it's not shown on the page, or it is shown outside
    > > the panel?

    >
    > The drop down list in question was displayed on the page, but not in the
    > updatePanel in the first table cell. I've subsequently realised where I'd
    > gone wrong...
    >
    > I was adding the second drop down list to the update panel which was
    > correct, but then I had another line of code which was adding the same drop
    > down list to the second table cell - it would seem that rather than generate
    > an error message about the same control being on the page with the same ID,
    > instead it *didn't* add it to the updatePanel in favour of adding it to the
    > table cell as this was the order of the code etc...
    >
    > All working now...
    >
    > Thanks for your reply Alexey.
    >
    > Regards
    >
    > Rob


    Ok, good that you solved it!
     
    Alexey Smirnov, May 15, 2007
    #4
    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. =?Utf-8?B?RCBTaGVsZG9u?=

    Adding validation controls programmatically

    =?Utf-8?B?RCBTaGVsZG9u?=, May 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,840
    =?Utf-8?B?RCBTaGVsZG9u?=
    May 11, 2004
  2. Tim Marsden

    Adding controls programmatically.

    Tim Marsden, May 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    585
    Steven Cheng[MSFT]
    May 25, 2004
  3. Chakravarti Mukesh

    Adding Controls Programmatically

    Chakravarti Mukesh, Jan 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    3,995
    brijesh patel
    Feb 14, 2013
  4. Replies:
    0
    Views:
    495
  5. Replies:
    4
    Views:
    542
Loading...

Share This Page