Asp – Creating a strongly-typed view in MVC RC1

asp.net-mvc

I'm trying to add a strongly-typed view to the sample app that's created when you create a new MVC project, but I'm not getting something. I added a "Warehouse.dbml" LINQ to SQL file in the Models folder, which contains one table. When I go to the Views folder and right-click and select Add | View, all I see under "Create a strongly-typed view" are the types that come with the sample app:

  • MyProject.AccountMembershipService
  • MyProject.FormsAuthenticationService

What step(s) am I missing for my table to be an available type?

Best Answer

Have you tried looking in your web.config and including those namespaces?

<namespaces>
    <add namespace="System.Web.Mvc"/>
    <add namespace="System.Web.Mvc.Ajax"/>

You would add another element with something like

<add namespace="MyProject.Data" />

That should fix it.

Related Topic