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 questi开发者_Python百科on 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")
Have you tried using full path?
@Html.RenderPartial("~/Views/Shared/MyPartialControl.cshtml")
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
精彩评论