tags:

views:

77

answers:

2

Firstly, I've done a build, I've done a clean, I've done a rebuild, of both the project and the solution, so that's not the problem.

When I change my model for some reason the intellisense (in fact, it's not just the intellisense as if I do a build it comes up with an error as well) doesn't work. I have a model under ViewData.Model.ContractCostCentre which exists. VS isn't picking this up, at all. Instead, it's referring to an old one which has since been deleted and replaced with the prior one, this is called ViewData.Model.ContractCCList. So in my view I'm having to iterate over a ViewData.Model.ContractCCList despite this not even existing in my *.dbml file.

This isn't the first time I've had this problem, it seems to happen quite often if I change my dbml file (and it's likely to change as we work on highly progressive systems which are always subject to change).

Any ideas?

A: 

can you look into your ????.designer.vb or .cs, depend which language you are using

if you don't see that file, show all file in solution

intellisense is using that file

Fredou
ContractCostCentre is in the designer. The only thing I see fishy is that <Table(Name:="")> is blank, but that's because it's custom. My other custom model doesn't have one specified either, and intellisense resolves that name. So that can't be the problem.
Kezzer
+1  A: 

Kezzer,

At the top of your View, there is part of a line of code that determines what model type the page uses. It should look something like this (my example is in c#):

Inherits="System.Web.Mvc.ViewPage<ViewData.Model.ContractCCList>"

Change it to look like this:

Inherits="System.Web.Mvc.ViewPage<ViewData.Model.ContractCostCentre>"
Robert Harvey
I'm returning multiple result sets, so I have a class called ContractsViewData which defines IList(Of T) of the ContractCostCentre. This is probably where the problem lies due to me using the IMultipleResult interface. Intellisense just can't keep up with it.
Kezzer