tags:

views:

174

answers:

1

I have a user control in a repeater that I need to pass data to during the databound event, so I've created two public properties in the control. How do I access these properties from the page's codebehind class?

+4  A: 

During the databind event in the repeater?

MyUserControl myControl = (MyUserControl)e.item.FindControl("NameInASPX");
myControl.MyCustomProperty = foo;
FlySwat
Where does the MyUserControl type come from? In my case it doesn't exist.
Adam Lassek
For whatever reason, Visual Studio wasn't aware of the type of my user control before, and now it is. VS's IDE magic can be very fickle sometimes.
Adam Lassek