<li>@Html.ActionLink("UserManagement", "Index", "User")</li>
<li>@Html.ActionLink("LogOff", "Index", "Home")</li>
答案 0 :(得分:2)
您可以执行以下操作:
@if(User.Identity.IsAuthenticated) {
<li>@Html.ActionLink("UserManagement", "Index", "User")</li>
<li>@Html.ActionLink("LogOff", "Index", "Home")</li>
}