<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SetPassword.aspx.cs" Inherits="eDocument.Server.Administrator.User.SetPassword" MasterPageFile="~/Site.Master"  %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <h1 class="skjema-admin__page-title">
        Sett nytt passord
    </h1>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Oppgi nåværende passord
        </label>

        <asp:textbox 
            id="txtExistingPassword" 
            CssClass="skjema-admin__page__text"
            TextMode="Password" 
            runat="server" 
            MaxLength="300">
        </asp:textbox>

        <asp:RequiredFieldValidator 
            runat="server" 
            ControlToValidate="txtExistingPassword" 
            Display="Dynamic" 
            ForeColor="Red">
            *
        </asp:RequiredFieldValidator> 
    </div>
    
    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Nytt passord - minst seks tegn, hvorav minst 1 stor bokstav, minst 1 liten bokstav og minst 1 tall/spesialtegn
        </label>

        <asp:textbox 
            id="txtPassword" 
            CssClass="skjema-admin__page__text"
            TextMode="Password" 
            runat="server" 
            MaxLength="300">
        </asp:textbox>

        <asp:RequiredFieldValidator 
            runat="server" 
            ControlToValidate="txtPassword" 
            Display="Dynamic" 
            ForeColor="Red">
            *
        </asp:RequiredFieldValidator>

        <asp:RegularExpressionValidator 
            runat="server" 
            ControlToValidate="txtPassword" 
            Display="Dynamic" 
            ForeColor="Red" 
            ValidationExpression="(?=^.{6,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$">
            Minst seks tegn, hvorav minst 1 stor bokstav, minst 1 liten bokstav og minst 1 tall/spesialtegn
        </asp:RegularExpressionValidator>
    </div>
    
    <asp:button 
        id="btnUpdate" 
        runat="server" 
        Text="Oppdater" 
        CssClass="skjema-admin__button skjema-admin__button--primary"
        onclick="btnUpdate_Click">
    </asp:button>

    <asp:Label runat="server" id="lblErrorMessage" ForeColor="Red"></asp:Label>
    <asp:Label runat="server" id="lblOkMessage" ForeColor="Green"></asp:Label>
</asp:Content>