User Control inside User Control

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 Property
 

 Thank you


100 years live, 100 years learn
0
Access
6/1/2007 6:25:00 AM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 5 followers.

💬 2 Replies
👁️‍🗨️ 759 Views

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
Jessica
6/4/2007 2:39:43 AM

That did it. Thanks a lot.


100 years live, 100 years learn
0
Access
6/4/2007 4:59:47 AM
Reply: