tags:

views:

34

answers:

1

How to do like this:

public class Base<T>: T{
   public OneProp{ get{ return new OneProp(); } }
}

public class BasePage: Base<Page>{}
public class BaseMaster: Base<MasterPage>{}
public class BaseUserControl: Base<UserControl>{}

Extension methods are not good, cause they are static and not property. Also we have copy-paste methodology:)

+2  A: 

Personally, these three concepts are all very different (Pages, Master Pages, and UserControls). I don't think a single base class for all three is a good idea.

If you want to share some logic that's customized to you across all three, I'd have separate base classes (with appropriate info) encapsulate your "special logic" class and expose it appropriately for that specific type.

Reed Copsey
I need thread-safe access to one Property from any control, like I have Request property.
dynback.com