删除日志后的链接 [英] Delete a link after log on
本文介绍了删除日志后的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的第一个步骤,以使用MVC3,并在新创建的MVC web项目,我已经建立了一个名为新会员注册旁边的首页找到,我登录后标签,我想它消失,但我不知道该怎么做。
I am on the first steps to use MVC3, and in the newly created MVC web project, I have set up for a tab called Sign Up to locate next to Home, after I log on, I would like it to disappear but I don't know how to do that.
推荐答案
使用剃须刀
的如果
语句确定用户进行身份验证:
Use Razor
's if
statement to determine if user is authenticated:
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
@if (!User.Identity.IsAuthenticated)
{
<li>@Html.ActionLink("SignUp", "SignUp", "Home")</li>
}
</ul>
这篇关于删除日志后的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文