I have an ASPX with user controls in it called UC1.
There is another user control called UC2 within user control UC1.(UC1 - parent , UC2 - child)What I need to do is to pass value of the text box that’s located inside user control UC1 to UC2.
This is the code I put into user control UC1. How to I read it in User control UC2?
Public ReadOnly Property propCountryName() As TextBox Get Return Me.txtCountrygName End Get End PropertyThank you
100 years live, 100 years learn
![]() |
0 |
![]() |
Hello,
In UC2,
try the followin code
Dim tb As TextBox=CType(Parent.FindControl("TextBox1"), TextBox)
tb.Text
Hope it helps,
Jessica
Jessica Cao
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
![]() |
0 |
![]() |
That did it. Thanks a lot.
100 years live, 100 years learn
![]() |
0 |
![]() |