Suja Shyam
Suja Shyam

Reputation: 971

Accessing controls of a user control inside a child user control

I have an aspx page with a usercontrol say UC1. UC1 is using another usercontrol say UC1.1 and other controls like dropodown, date picker, cute editor etc. I want to get conrols of UC1 in the button click of UC1.1. How can this be achieved?

Upvotes: 0

Views: 1823

Answers (2)

Suja Shyam
Suja Shyam

Reputation: 971

In UC1.1 we can get the usercontrol UC1. Gave these code in UC1.1:

Dim p As Page = HttpContext.Current.Handler
Dim ctrl1 As UserControl = p.FindControl("UC1")
Dim ddlStatus As DropDownList = ctrl1.FindControl("ddlStatus")

Upvotes: 1

Vijay EK
Vijay EK

Reputation: 184

You can access parent controls using control collection from the parent. Parent.Findcontrol(id)

Upvotes: 0

Related Questions