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