473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

When adding controls programmatically...

...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</divtags, thus not in the update panel - any thoughts?

Regards

Rob
May 15 '07 #1
3 1968
On May 15, 11:23 am, "Rob Meade" <ku.shn.tsews.t...@edaem.borwrote:
..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</divtags, 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.

May 15 '07 #2
"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
May 15 '07 #3
On May 15, 2:22 pm, "Rob Meade" <ku.shn.tsews.t...@edaem.borwrote:
"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!

May 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Big D | last post by:
Hi all, I'm having a problem adding controls to a panel dynamically. I have a usercontrol that I create and try to add 5 times to the panel, but I only ever see the first control. I know it's...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
2
by: Tim Marsden | last post by:
Hi, This is what I am doing, please comment if this is the correct way. I need to add controls to a form dynamically. Within the Page_Load event (is not Postback) I run a routine to create the...
2
by: Chakravarti Mukesh | last post by:
Hi All, I tried to add controls on page (C#) by using Page.Controls.Add(ctrl); it displays me an error Server Error in '/AgentExtension' Application....
0
by: mark.norgate | last post by:
Righto, a problem with programmatically created controls. Well, in that kind of area anyway. I'm creating and adding controls to my page using TemplateControl.LoadControl quite successfully, but...
2
by: johnb41 | last post by:
I want to create a textbox programmatically and add the SAME textbox to to different panels. This code does not work: Dim tb As New TextBox tb.text = "xyz" Panel1.Controls.Add(tb)...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
3
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a...
0
by: Rene Goris | last post by:
Hi all, I am trying to add meta:resourcekey's to database programmatically looping throug webcontrols, but i cann't read the 'meta:resourcekey' from the webcontrol. The 'meta:resourcekey' will...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.