有没有办法在区域之间分享部分剃刀视图?
例如,登录部分,如果我使用@ Html.Partial(“_ LoginPartial”),则会发现,但Html.ActionLink生成的URL对于调用区域是本地的(即使部分本身不是该区域的一部分).
_LoginPartial.cshtml is in /Views/Shared/_LoginPartial.cshtml Calling view is inside /Areas/Somearea/Views Links generated are like: http://example.com/Somearea/Account/Login But should always be: http://example.com/Account/Login
部分视图来源:
@if(Request.IsAuthenticated) { <text>Welcome <b>@Context.User.Identity.Name</b>! [ @Html.ActionLink(@Messages.logout,"logout","Account") ]</text> } else { @:[ @Html.ActionLink(@Messages.Login,"Login","Account") ] }
谢谢