When adding controls programmatically...

  • Thread starter Thread starter Rob Meade
  • Start date Start date
R

Rob Meade

...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
 
..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.
 
...
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
 
...


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!
 
Back
Top