On Wed, 23 Apr 2008 16:45:01 -0700, DotNetNewbie <sn***********@yahoo.com>
wrote:
[...]
I want to create my own custom ViewPage class, and inherit from the
generic type.
I tried:
public class MyViewPage : ViewPage<TViewDate>
I get a compile error:
Is it possible to do this??
First you need to decide what "this" is. But once you've done that, yes.
:)
One alternative is to declare your class like this:
public class MyViewPage<TViewData: ViewPage<TViewData>
Then you would need to provide the generic type parameter when using your
class.
If you expect your class to only ever be used with one type as the type
parameter to ViewPage<TViewData>, then just provide that type parameter
when you declare your class, like this:
public class MyViewPage : ViewPage<MyViewDataClass>
where "MyViewDataClass" is whatever is your actual type that you want to
use with the generic class.
Pete