I have two UserControl classes, RequiredFields and OptionalFields. I wanted to have a base class, Fields, that would inherit from UserControl and contain methods that both RequiredFields and OptionalFields would use. However, when I try to do that, I get the following error:
Partial declarations of 'MyNamespace.OptionalFields' must not specify different base classes
Here are my class definitions:
public partial class OptionalFields : Fields
public partial class RequiredFields : Fields
public abstract class Fields : UserControl
Even if I make Fields a partial class instead of abstract, or if I make it a regular non-abstract non-partial class, I get the same error.
Is what I'm wanting to do possible/reasonable? If not, what is the best way of sharing methods between UserControl instances?