开发者

MVC3 where to pu the logout display

i'm creating an MVC3 C# application. i createtd a login attribute which only appears when a 开发者_开发问答user chooses to either create,delete,or edit data stored. To logout, i put the HTML code in th layout view, but its displaying on th homepage even if the user did not log in. how do i make it display on all pages after user has logged in, and when user logs out, it is no mor displayed?


Just check if the user is authenticated

@if (Request.IsAuthenticated) {
   <div>control to logout</div>
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜