开发者

Using a partial view across mutiple areas - MVC4

开发者 https://www.devze.com 2023-04-11 10:45 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号