简体   繁体   中英

View in an Area gives doesn't recognize 'ActionLink', 'Parital', 'ViewBag' even tho other areas work

This question is similar to the ff: Razor HtmlHelper Extensions (or other namespaces for views) Not Found

I already applied a sub web.config in that area and it can'tb be a nuget issue because there are already other areas that has the same structure but have their views work at it should. Below is a representation of the areas:

Areas
--<Area1 - Folder>
----Views - Folder
------<View1 - Folder>
--------Shared - Folder
--------_ViewStart.cshtml
--------web.config
--<My Area - Folder>
----Views - Folder
------<View1 - Folder>
--------Shared - Folder
--------_ViewStart.cshtml
--------web.config

Please note that in the above example, Area 1 and its views already work and I simply added a new one. As for the contents of the _Viewstart.cshtml, it only points to a file in the shared folder that consists of the general layout that is to be shared by all of the views in the area.

I am trying to figure this out otherwise I'd have to port every part of every page to a new View

My colleague placed this on top of the page @using KCC_MVC.Helpers and it worked when we tried to build. The funny thing was, it was grayed out (meaning it wasn't being used by the view). So I commented it out and it worked :D It leads me to think its some sort of caching thing w/ the assemblies. It's as if the IDE needs to be "reminded" of its visible assemblies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM