开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜