Click here to Skip to main content
15,899,937 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody.
I had a question about accessing controls in the page with Page.Controls.
Could we access a control in this way by the ID?
Posted

1 solution

Yes we can. Use Control.FindControl Method (String)[^].
C#
// Find control on page.
Control myControl1 = FindControl("TextBox2");
 
Share this answer
 
v2
Comments
rogerfederer670 10-May-14 13:22pm    
Thanks so much.
Welcome. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900