How can I create generic class from System.Web.Mvc.ViewPage
How can I create 开发者_如何学编程generic class from System.Web.Mvc.ViewPage
ViewPage is already defined in a generic form, so you can do:
public class MyViwePage : System.Web.Mvc.ViewPage
You can specify this as the base page class for your views in the inherits attribute; the web.config in the views folder has a basePageType (or similarly named attribute) where you can define this base class type too.
What features are you looking to provide? It may be easier to use extension methods to add functionality.
HTH.
精彩评论