2

Does anyone know why MVC classes are unavailable (highlighted in red) in my views? I even tried to upgrade my View Studio from 2015 to 2017 Community but didn't help. I am running .NET 4.6. MVC is version: 5.2.3.0, I am not sure if I am missing a reference or something? Please help me...

enter image description here

Nitesh Kumar
  • 1,774
  • 4
  • 19
  • 26
Morgs
  • 1,558
  • 3
  • 19
  • 34
  • your page works ? its not only intellisense doesn't work ? – GGO Jan 25 '18 at 13:13
  • You need to add the namespaces either in the `using` or prefix the types. This is in reference to `@model` where you specified it is of type `Dictionary` but you did not qualify it with a namespace or provide the namespace in a `using` block. Alternatively you can specify global namespaces in the web.config in the `View` folder. – Igor Jan 25 '18 at 13:14
  • Also your IDE will generate compile time errors, read them as they will tell you what is wrong. You can then fix your code based on that. – Igor Jan 25 '18 at 13:18
  • Thanks everyone, what namespace do `@model`, `@Url`, or `@ViewBag` come from? If I try `System.Web.Mvc.Url` it still does not recognize it. Neither does it recognize it if I use `System.Web.Razor` or add the `@using System.Web.Razor` `@using System.Web.Mvc` namespaces, it still doesn't help. – Morgs Jan 25 '18 at 13:23
  • You may find the answer here: https://stackoverflow.com/questions/6389055/the-name-model-does-not-exist-in-current-context-in-mvc3/30078405 –  Jan 25 '18 at 13:27
  • I would like to thank everyone that helped me and @buffjape for pointing me into the right direction. After correcting the MVC and Razor versions, I seem to have come right... – Morgs Jan 25 '18 at 14:04

0 Answers0