It should be possible here to use generics and pass the class type of the model. However, Visual Studio 2008 is not accepted:
<%@ Page Inherits="System.Web.Mvc.ViewPage(of IEnumerable(of MyNamespace.MyClass))" %>
I get the following validation error (underlined in VS): 'Context' is not a member of 'ASP._views___home___index__asp'
I get the following runtime error: BC30456: 'InitializeCulture' is not a member of 'ASP._views___home___index__asp'.
Note. I am using Visual Basic.NET, but this should not affect the problem.
Here are some screenshots of the views and controllers, I hope someone sees what happens (TestClass is a simple class with the ID and Name property):
, Maik Koster , :
- System.Web.Mvc( GAC, )
- . → ...
ASP.NET MVC page inherits :
<%@ Page Inherits="System.Web.Mvc.ViewPage" %>