HTML Helpers Unavailable in Partial View

I created a partial view and cannot access the Html namespace for HTML helpers. It is available on the main screen. Did I miss something?

enter image description here

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

+6
source share
1 answer

check if your view has a web.config directory and 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> 
+1
source

Source: https://habr.com/ru/post/957923/


All Articles