开发者

MVC 3 - Actionlink - Show/Hide Register if logged in/logged out

开发者 https://www.devze.com 2023-03-25 09:46 出处:网络
How do I: 1. Move the regi开发者_开发百科ster link \"@Html.ActionLink(\"Register\", \"Register\")\" to the home page

How do I: 1. Move the regi开发者_开发百科ster link "@Html.ActionLink("Register", "Register")" to the home page and 2. Show and Hide it based on if a user is logged in or logged out

I saw this tutorial awhile back but I can't find it again

-Jonny


1: Move the register link "@Html.ActionLink("Register", "Register")" to the home page

Ans: no tutorials link given so i cant answer this

2: Show and Hide it based on if a user is logged in or logged out

inside razaor view do this

  @if (Request.IsAuthenticated)
  {
     //whatver
  }
0

精彩评论

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