The name 'ViewBag' does not exist in the current context

前端 未结 16 1297
逝去的感伤
逝去的感伤 2020-11-28 08:24

I am trying to use ViewBag in my application, I have all of the recent dlls, the latest version of MVC 3, but yet I am still getting the Error:

\"The

16条回答
  •  我在风中等你
    2020-11-28 08:56

    I had the same problem in a solution that had been upgraded to MVC 5 in Visual Studio 2015.

    In the web.config file within the Views folder (not the root web.config), I updated the version number referred to in from 2.0.0.0 to 3.0.0.0.

    
        
          
            

提交回复
热议问题