How can I declare my Basepage class in an asp.net webforms project to also implement IBasePage?
public abstract class BasePage<T> : Page where T : class
{
}
and the interface
public interface IBasePage
{
UserProfile UserProfile { get;}
bool IsStreamingAdmin {get;}
int? EmplId {get;}
}
my ultimate goal is to be able to write code this like:
IBasePage page = HttpContext.Current.Handler as IBasePage;
if (page.IsStreamingAdmin)
{
//do something here....
}
Your question isn’t totally clear to me, but couldn’t you just do: