initial commit
[CPE_learningsite] / CPE / CPE.App / CPE.App.Web / Views / Shared / _LoginPartial.cshtml
1 @using Microsoft.AspNet.Identity
2 @if (Request.IsAuthenticated)
3 {
4     using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
5     {
6     @Html.AntiForgeryToken()
7
8     <ul class="nav navbar-nav navbar-right">
9         <li>
10             @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
11         </li>
12         <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
13     </ul>
14     }
15 }
16 else
17 {
18     <ul class="nav navbar-nav navbar-right">
19         <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
20         <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
21     </ul>
22 }