Reputation: 34929
I want to use my own WebViewPage
in MVC3 and When I create an abstract class with specific name and change the WebViewPage
to my own type in Web.config, I get this error:
Compiler Error Message: CS0308: The non-generic type 'Aya.Moj.Web.Controllers.MojWebViewPage' cannot be used with type arguments
Custom WebViewPage
code:
namespace Aya.Moj.Web.Controllers
{
public abstract class MojWebViewPage : WebViewPage
{
//just for test
public string Boo { set; get; }
}
}
Upvotes: 2
Views: 674
Reputation: 14084
You should inherit from WebViewPage<TModel>
because you're going to pass a Model to this WebViewPage
Then your WebViewPage
will look like this :
namespace Aya.Moj.Web.Controllers
{
public abstract class MojWebViewPage<T> : WebViewPage<T>
{
//just for test
public string Boo { set; get; }
}
}
Upvotes: 5