Web Forms Question:
How to access a control inside a UserControl in .net?
Answer:
Assume there is a user control called UC and there is only a TextBox control inside it. Now drag this user control into a web page, you can use the following code to visit the TextBox control.
((TextBox)UC1.FindControl("TextBox1")).Text = "demo";
((TextBox)UC1.FindControl("TextBox1")).Text = "demo";
Previous Question | Next Question |
How to disable some dates in Calendar control in web forms? | How to create a dynamic control in dot net? |