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
2008-10-02 22:03:51
Where does the MyUserControl type come from? In my case it doesn't exist.
Adam Lassek
2008-10-03 13:35:59
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
2008-10-03 13:57:42