Hi, I have an MVC project setup, and I've brought the subsonic Active Record templates into my project, and they generated successfully and I can use the subsonic classes to access my database. However, how do I create a strongly typed view using the subsonic generated classes? When I select "add View" and I check the checkbox to create a strongly-typed view, none of the generated classes from subsonic for my data are available. How do I do this?
A:
I would try it manually and see if you get any errors. Crack open your view and change:
Inherits="System.Web.Mvc.ViewPage"
to
Inherits="System.Web.Mvc.ViewPage<Your.Strongly.Typed.ClassName>"
You can also add the namespace in the web.config under pages->namespaces
<add namespace="Your.Strongly.Typed" />
if you want to shorten the change to:
Inherits="System.Web.Mvc.ViewPage<ClassName>"
Jeff Sheldon
2010-07-28 13:42:51