In MVC5, I know you can have a Shared
folder under Views
and then use the RenderPartial
to render in partial views.
Is there only ever one Shared
folder for the whole website?, or is it possible to have multiple 'Shared' areas?
For instance, I have the following structure on my website:-
\Views
\Views\Shared
\Controllers
\Models
\Identity
\Identity\Views
\Identity\Controllers
\Identity\Models
I was wondering if it would also be possible for the Identity
folder to have its own Shared
folder as well, that RenderPartial would also work for?
If this is possible, can I render a PartialView
from this other Shared
folder? I had tried this but wasn't successful - even if I directly reference the View using the tilde ~
approach, but it doesn't seem to like running throwing an exception
. However if I put the PartialView
in my \Views\Shared
folder then everything works.