PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/AnotherStartup/Account/ChangePassword.cshtml

#
Razor | 53 lines | 51 code | 1 blank | 1 comment | 3 complexity | b9f38690469aa27d02503738ac015c2f MD5 | raw file
  1. @{
  2. WebSecurity.RequireAuthenticatedUser();
  3. this.Init(layout: "~/_SiteLayout.cshtml", title: "Change Password", action:Account.ChangePassword.Init);
  4. }
  5. <form method="post" action="">
  6. <fieldset>
  7. <legend>Change Password Form</legend>
  8. <p>
  9. Use this form to change your password. You'll be required to enter your current password.
  10. Click <a href="@Href("~/Account/ForgotPassword")" title="Forgot password page">here</a> if you've forgotten your password.
  11. </p>
  12. @*we have submitted a postback and password changed successfully*@
  13. @if (Page.Success)
  14. {
  15. <p class="message success">
  16. Your password has been updated!
  17. </p>
  18. }
  19. else if(!Page.IsValid)
  20. {
  21. <p class="message error">
  22. @(Page.Errors.Provider.Message ?? "Password change failed. Please correct the errors and try again.");
  23. </p>
  24. }
  25. <ol>
  26. <li class="current-password">
  27. <label for="currentPassword">Current Password:</label>
  28. <input type="password" id="currentPassword" name="currentPassword" title="Current password" @if(Page.Errors.CurrentPassword.IsError){<text>class="error-field"</text>} />
  29. @if (Page.Errors.CurrentPassword.IsError) {
  30. <label for="currentPassword" class="validation-error">@Page.Errors.CurrentPassword.Message</label>
  31. }
  32. </li>
  33. <li class="new-password">
  34. <label for="newPassword">New Password:</label>
  35. <input type="password" id="newPassword" name="newPassword" title="New password" @if(Page.Errors.NewPassword.IsError){<text>class="error-field"</text>} />
  36. @if (Page.Errors.NewPassword.IsError) {
  37. <label for="newPassword" class="validation-error">@Page.Errors.NewPassword.Message</label>
  38. }
  39. </li>
  40. <li class="confirm-password">
  41. <label for="confirmPassword">Confirm Password:</label>
  42. <input type="password" id="confirmPassword" name="confirmPassword" title="Confirm new password" @if(Page.Errors.ConfirmPassword.IsError){<text>class="error-field"</text>} />
  43. @if (Page.Errors.ConfirmPassword.IsError) {
  44. <label for="confirmPassword" class="validation-error">@Page.Errors.ConfirmPassword.Message</label>
  45. }
  46. </li>
  47. </ol>
  48. <p class="form-actions">
  49. <input type="submit" value="Change Password" title="Change password" />
  50. </p>
  51. </fieldset>
  52. </form>