Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML helpers not available in partial view

I created a partial view and can't access the Html namespace for HTML Helpers. It's available in the main view. Am I missing something?

enter image description here

EDIT: I should mention that I'm using ASP.NET MVC 5.

like image 214
Metaphor Avatar asked Nov 12 '13 14:11

Metaphor


1 Answers

check is there a web.config in you views directory and in the web.config

<pages pageBaseType="System.Web.Mvc.WebViewPage">
  <namespaces>
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Optimization"/>
    <add namespace="System.Web.Routing" />
  </namespaces>
</pages>
like image 189
chenZ Avatar answered Oct 19 '22 03:10

chenZ