简体   繁体   中英

Missing model class when adding a view in ASP.NET MVC 3

In my ASP.NET MVC 3 project i have a reference to my DomainModel project.

The problem occurs when i try to create a strongly-typed view. In the model class list my models from the DomainModel doesn't exist.

I did the try the following with no success(From another thread):

-remove reference to the library containing the model
-clean project
-close VS
-reopen VS
-rebuild project (VS throws errors)
-re-add reference to the model library
-rebuild project

I also tried to update VS2010 to VS2010 SP1 same problem.

Any suggestion?

Well if you cannot see the model in the dialog box try to directlly call it from the view like this:

@model  IEnumerable<Ieagle.WebSelfCare.Models.InvoicingIndex>

In case you have an IEnumerable Model otherwise

@model Ieagle.WebSelfCare.Models.Person

If you cant reach your models like this than you may have problems within the models

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM