What I want to achieve is something like this below, which Visual Studio complains about and I don’t know how to achieve it:
public abstract class My_BaseControl<T> : T, IRightBasedUsability
where T : System.Web.UI.WebControls.WebControl
{
// Some methods that I want to have for all
//the extended asp.net controls along my application
//which implements IRightBasedUsability
}
Perhaps c# extension methods are in this case a way to solve your problem.
@see http://msdn.microsoft.com/en-us/library/bb383977.aspx
Eric De Carufel wrote some interesting articles about extension methods and how to manage their scope:
http://blog.decarufel.net/2009/02/extension-methods-series-managing-scope.html