Today when I was going to create a partial view I got this error. The partial would contain a form and would be strongly typed with its corresponding model for validation. Although when debugging this through VS2010 I got an error. I checked my log file and saw this error.
c:\Users\projectname\AppData\Local\Temp\Temporary ASP.NET Files\root\ed98b972\6e57e58c\App_Web_index.cshtml.925dc4ed.1cocjzqb.0.cs(31): error CS0234: The type or namespace name 'MailModel' does not exist in the namespace 'Web.NameOfProject.Models' (are you missing an assembly reference?)
At first I thought that I was rendering the partial the wrong way. So I tried both with:
@Html.Partial("_FeaturedProduct") <---this from my view
and
@Html.RenderPartial("_FeaturedProduct") <--- this from my view
I also tried some other things but none worked. The thing is that here:
@model Web.Project.Models.MailModel <-- it recognizes the model
So that I can acces the fields in my form. Despite this it just won't render. I tried changing to a different model, one that I made yesterday and with that one there is no problem. I also tried removing this model, changing the name and so on but still the problem remains. This is all probably very basic but keep banging my head against the wall with this. Any suggestions?!
Regards!
Note that I have checked all references and namespaces and just can't see that anything is missing.