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 / General / July 2007

Tip: Looking for answers? Try searching our database.

Easy way to findcontrol?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HockeyFan - 16 Jul 2007 15:37 GMT
I have the following string from one of the controls, inside gridview,
inside a control, inside a repeater item.
rptBorrower_ctl00_ctlAuthorizedSigners_gvAuthorizedSigners_ctl04_

The control was a button, but I stripped off the name of that button
and would like to FindControl a textbox that I know is on the same
line of that grid as the button, so it's prefix will be the same.
Do I have to go FindControl the repeater, and then the custom control,
and then the gridview within that control before I can finally
FindControl the textbox?  Is there an easier way to do this?
Peter Bucher [MVP] - 16 Jul 2007 16:18 GMT
Hi HockeyFan

> Do I have to go FindControl the repeater, and then the custom control,
> and then the gridview within that control before I can finally
> FindControl the textbox?  Is there an easier way to do this?
yes, there is a simplified way to do this.
find the control recursively:
http://www.google.ch/search?hl=de&q=findcontrol+recursive&meta=
but use this method carefull, otherwise it could cost a bit of performance.

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET


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



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