The name 'model' does not exist in current context in MVC3

后端 未结 20 2239
-上瘾入骨i
-上瘾入骨i 2020-11-29 02:53

I added a cshtml page in an project. When I tried to add the following declaration to it, I get an error: \"The name \'model\' does not exist in current context\".



        
20条回答
  •  误落风尘
    2020-11-29 03:07

    Had similar problems using VS2012 and VS2013.
    Adding the following line to in the main web.config worked:

    
    

    If the line was already there but said 2.0.0.0, changing it to 3.0.0.0 worked.

提交回复
热议问题