문제

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?

도움이 되었습니까?

해결책

You probably need to compile your project first.

다른 팁

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>"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top