The next generation of the Teknik Services. Written in ASP.NET.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_LoginPartial.cshtml 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. @using Microsoft.AspNet.Identity
  2. <ul class="nav navbar-nav pull-right">
  3. @if (Request.IsAuthenticated)
  4. {
  5. <li class="dropdown">
  6. <a href="#" id="user_menu" class="dropdown-toggle" data-toggle="dropdown">@User.Identity.Name <strong class="caret"></strong></a>
  7. <ul class="dropdown-menu" role="menu" aria-labelledby="user_menu">
  8. <li>
  9. <a href="@Url.Action("Index", "Profile", new { area = "Profile" })/@User.Identity.Name">Profile</a>
  10. </li>
  11. <li>
  12. <a href="@Url.Action("Index", "Blog", new { area = "Blog" })/@User.Identity.Name">Blog</a>
  13. </li>
  14. @if (User.IsInRole("Admin"))
  15. {
  16. <li>
  17. <a href="@Url.Action("Index", "Admin", new { area = "Admin" })">Administration</a>
  18. </li>
  19. }
  20. <li>
  21. @Html.ActionLink("Sign Out", "Logout", "Profile", new { area = "Profile" }, null)
  22. </li>
  23. </ul>
  24. </li>
  25. }
  26. else
  27. {
  28. <li class="dropdown">
  29. <a class="dropdown-toggle" href="#" data-toggle="dropdown" id="reg_dropdown">Sign Up <strong class="caret"></strong></a>
  30. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
  31. @Html.Partial("../../Areas/Profile/Views/Profile/Register", new Teknik.Areas.Profile.ViewModels.RegisterViewModel())
  32. </div>
  33. </li>
  34. <li class="dropdown">
  35. <a class="dropdown-toggle" href="#" data-toggle="dropdown" id="login_dropdown">Sign In <strong class="caret"></strong></a>
  36. <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
  37. @Html.Partial("../../Areas/Profile/Views/Profile/Login", new Teknik.Areas.Profile.ViewModels.LoginViewModel())
  38. </div>
  39. </li>
  40. }
  41. </ul>