Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find control

Status
Not open for further replies.

rceadmin

Programmer
Dec 19, 2008
1
ES
I have a ASPX page with a repeater control and inside of ItemTemplate I put the user control. I would like to access to the repeater properties and method in the codebehind of the user control.

<asp:Repeater ID="newsRepeater" runat="server">
<ItemTemplate>
<uc1:MyControl runat="server" id="my_control" .......

Codebehind of the user control:

public partial class my_control : System.Web.UI.UserControl
{
string str = newsRepeater.ID??? (Something like that)
}

How can I do that?
 
You are thinking backwards. You have to access the properties of the UC from the repeater not the other way around.

Use the itemdatabound event of the repeater to find the uc and set a property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top