Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
205 Points
57 Posts
Dec 13, 2007 06:08 AM|LINK
I've successfully created .aspx view pages without code behind by replacing the first line with this:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
However, trying to change it to inherit the generics to get typed view data like the following doesn't seem to work:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MvcApplication.Models.MyModel>" %>
Is there some trick I'm missing here? Can you not use a generic class in the Inherits attribute?
MVC generics viewpage typedview viewdata generic
ghotiman
Member
205 Points
57 Posts
Typed ViewPage Using Generics Without Code Behind
Dec 13, 2007 06:08 AM|LINK
I've successfully created .aspx view pages without code behind by replacing the first line with this:
However, trying to change it to inherit the generics to get typed view data like the following doesn't seem to work:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MvcApplication.Models.MyModel>" %>Is there some trick I'm missing here? Can you not use a generic class in the Inherits attribute?
MVC generics viewpage typedview viewdata generic