Matt Seymour
Matt Seymour

Reputation: 9395

Using a partial view across mutiple areas - MVC4

I am wanting to use a view across multiple areas. I have put the partial view in question into the main application Views/Shared folder, but I cannot seem to access this.

Does anyone know how to access the shared view folder?

The code i am currently using is the basic:

@Html.RenderPartial("MyPartialControl")

Upvotes: 1

Views: 7347

Answers (2)

Zaharan Haleed
Zaharan Haleed

Reputation: 21

Just in case, if you have not found the solution yet (I doubt)... try this, it worked for me.

@Html.RenderPartial("~\\Views\\Shared\\MyPartialControl.cshtml") for C# and single '\' for VB.NET

Upvotes: 2

Jakub Konecki
Jakub Konecki

Reputation: 46008

Have you tried using full path?

@Html.RenderPartial("~/Views/Shared/MyPartialControl.cshtml")

Upvotes: 9

Related Questions