 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 15th, 2004, 07:42 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Composite Controls and INamingContainer
Hello,
I was working with a composite control, that for the life of me wasn't working at all. I added "Implements INamingContainer" and it works fine. Any ideas why that is? That really peaked my curiosity.
Thanks,
Brian Mains
__________________
Brian
|
|

April 15th, 2004, 08:19 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Brian,
Where you working with nested controls?
The INamingContainer takes care of generating unique names within the entire page scope. So, if you have a TextBox inside a Repeater, this class makes sure that each TextBox gets a unique name in each Repeater item by prefixing the TextBox with the Repeater name / ID.
Simply implementing INamingContainer enables this behavior for your own controls.
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Suck it Up by Hed Planet Earth (Track 1 from the album: Blackout )
|
|

April 15th, 2004, 08:52 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Thanks for the response. I had a control that had a label, two textboxes, two labels, and a link button. However, after reading your response, it dawned on me that I used several LiteralControls to output HTML for a table element that would format these controls, and I bet that is what is causing the problems.
Thanks,
Brian
|
|

April 15th, 2004, 09:06 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You can take a look at the source of the page in the browser. If you see ID values with a colon, e.g.: myDataGrid:_ctl8:btnDelete you can be sure you had the INamingContainer at work.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Revelations by Hed Planet Earth (Track 14 from the album: Blackout )
|
|
 |