A workaround is to make ItemNotes a simple class that is derived from UserControl, and then create a separate user control that derives from ItemNotes and use that in the pages.
You can add all the properties/methods that you need to the ItemNotes class (possibly making them virtual or even abstract) and then implement them as needed in the deriving user control class.
This gives you
public class ItemNotes : UserControl
{
...
}
partial class ItemNotesControl : ItemNotes
{
...
}
DMW
All-Star
15943 Points
2353 Posts
Re: How to access a User Control from a Class
Jun 21, 2005 03:05 AM|LINK
A workaround is to make ItemNotes a simple class that is derived from UserControl, and then create a separate user control that derives from ItemNotes and use that in the pages.
You can add all the properties/methods that you need to the ItemNotes class (possibly making them virtual or even abstract) and then implement them as needed in the deriving user control class.
This gives you
public class ItemNotes : UserControl
{
...
}
partial class ItemNotesControl : ItemNotes
{
...
}
Dave