Razor Views not seeing System.Web.Mvc.HtmlHelper

后端 未结 22 1065
我在风中等你
我在风中等你 2020-11-27 05:27

I am in the process of upgrading to MVC4. I have followed the instructions at http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806 but in my Razor views and layou

22条回答
  •  -上瘾入骨i
    2020-11-27 06:02

    My situation only occurred after I created a custom class called BaseViewPage that overrode the WebViewPage class. I initially added the following to my Main Web.confg file:

    
    

    And the same to the View folders web.config file:

    
    

    I tried many of the other answers and none did the trick while still allowing me to keep my BaseViewPage class. The way I fixed it was to remove the pageBaseType attribute from the Main Web.config file only. Keep it in the View web.config.

提交回复
热议问题