The other day, I created a user control that dynamically creates a display of data from a given business object.
It works well, but I would like to use the control in other applications, and the way it is currently encapsulated is a subparameter.
My user control just contains the basic html controls and some internal properties, so I can access them from my other class.
In the same assembly, I have a DataManager class - it accepts IEnumerable and a link to the associated user control. The problem is that I have to handle implementation details, such as redrawing on the page_Init from the page that calls the control, since the actual user control does not know T.
Is there a way to pass a generic type to a user control to simplify things, or is there a way to store a reference to a DataManager without specifying T?
Thank you for your help!
source
share