Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / June 2006

Tip: Looking for answers? Try searching our database.

Finding the values of Dynamic Controls in a Composite Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryan - 12 Jun 2006 22:43 GMT
Hi Everyone,

 I've created a Custom Composite Control that creates a number of
children -- Hidden Input Fields, to be exact.  Because my control
implements INamingContainer, I can't guaruntee what the names or IDs of
these children will be after the control is rendered.

So, after a post, how do I get to these controls?

- FindControl?

- Loop through all controls looking at the IDs?

- Loop through Request.Form?

- Something else?

Thanks in advance for the suggestions!

  - Bryan
Alessandro Zifiglio - 13 Jun 2006 16:13 GMT
hi Bryan, just provide an explicit id to your child controls. True, a unique
namespace will be appended to the id value at runtime when the control
renders in the page. This however will not effect you from finding the
control in question in code, after a postback. All you need to do is use the
findcontrol method supplying the id you provided earlier. Since you are
using findcontrol in the namingcontainer, you are not expected to provide
the clientID.
Alessandro Zifiglio

> Hi Everyone,
>
[quoted text clipped - 16 lines]
>
>   - Bryan
Bryan - 14 Jun 2006 21:44 GMT
Excellent!  Thank you, Alessandro.

- Bryan

> hi Bryan, just provide an explicit id to your child controls. True, a unique
> namespace will be appended to the id value at runtime when the control
[quoted text clipped - 4 lines]
> the clientID.
> Alessandro Zifiglio

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.