-1

I want to use @Html helpers in my view,but Visual Studio does not know that my project is MVC4. I have set Using System.Web.Mvc

tereško
  • 58,060
  • 25
  • 98
  • 150
Saeed
  • 3,415
  • 3
  • 24
  • 41
  • Duplicate of [Razor Intellisense Not Working VS2010 SP1Rel MVC3 from WPI Win7 x64](http://stackoverflow.com/questions/6133090/razor-intellisense-not-working-vs2010-sp1rel-mvc3-from-wpi-win7-x64), [IntelliSense won't work for MVC Razor cshtml page](http://stackoverflow.com/questions/8481477/intellisense-wont-work-for-mvc-razor-cshtml-page), [How to get IntelliSense for Razor View Engine](http://stackoverflow.com/questions/3491456/how-to-get-intellisense-for-razor-view-engine). Please use the search. At least please explain how you created the project and what exactly you have changed and tried. – CodeCaster Jan 07 '14 at 11:54

2 Answers2

5

You are probably missing <add namespace="System.Web.Mvc" /> within your web.config file under your Views folder

Please open web.config file Under Views folder and check if there the above tag is within namespaces, if not add it and you should be able to use @Html within your Razor views without manually referencing the library in every view

Amila
  • 3,711
  • 3
  • 26
  • 42
0

Make sure that you are using Razor (.cshtml) instead of Asp.Net (.aspx) as the viewengine. You cant use @Html in Asp.Net viewengine views, there you should use <% Html

Webking
  • 1,822
  • 2
  • 20
  • 28