Last active
January 17, 2016 16:39
-
-
Save danieleli/e463d57fbd34fc705684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Microsoft.AspNet.Identity | |
<!-- do we have a user --> | |
@if (Request.IsAuthenticated) | |
{ | |
<!-- we have user, so display user name. --> | |
<div class="username"> | |
@User.Identity.GetUserName() | |
</div> | |
} | |
else | |
{ | |
<!-- no user so display register and login --> | |
<ul class="nav navbar-nav navbar-right"> | |
<li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li> | |
<li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li> | |
</ul> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment