The following CLR syntax works fine on my aspx page:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Website.MyBasePage`1[HomePageViewModel]" %>
But this C # syntax does not:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Website.MyBasePage<HomePageViewModel>" %>
Note that I do not use ASP.NET MVC, but this works fine when using System.Web.Mvc.ViewPage<> from ASP.NET MVC.
My MyBasePage as follows:
public class MyBasePage<TModel> : Page where TModel : class { public TModel Model { get { return (TModel)HttpContext.Current.Items["model"]; } } }
source share