Created
September 29, 2012 17:28
-
-
Save Buildstarted/3804658 to your computer and use it in GitHub Desktop.
Mvc Music Store Login Partial
This file contains hidden or 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
@if (Request.IsAuthenticated) { | |
<text> | |
Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })! | |
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) { | |
@Html.AntiForgeryToken() | |
<a href="javascript:document.getElementById('logoutForm').submit()">Log off</a> | |
} | |
</text> | |
} else { | |
<ul> | |
<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