@page
@model MyPage.ChangePassword.IndexModel
@using Microsoft.AspNetCore.Http
@{
    ViewData["Title"] = "비밀번호 변경";
    ViewData["LoggedInUserId"] = HttpContext.Session.GetString("LoggedInUserId");
    ViewData["LoggedIn"] = ViewData["LoggedInUserId"] != null;
    ViewData["ActivatedTabIndex"] = 2;
}

<div class="row" style="margin-top:20px">
    <div class="col-md-6">
        @Html.Partial("~/Views/MyPageTabs.cshtml")
        <h3>비밀번호 변경</h3><br />
        <form method="post" id="form">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="ChangePassword.PreviousPassword" class="control-label"></label>
                <input asp-for="ChangePassword.PreviousPassword" class="form-control" type="password" />
                <span asp-validation-for="ChangePassword.PreviousPassword" class="text-danger"></span>
                <span class="text-danger field-validation-error">@Model.ErrorMessage</span>
            </div>
            <div class="form-group">
                <label asp-for="ChangePassword.NewPassword" class="control-label"></label>
                <input asp-for="ChangePassword.NewPassword" class="form-control" type="password" />
                <span asp-validation-for="ChangePassword.NewPassword" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="ChangePassword.NewPasswordConfirm" class="control-label"></label>
                <input asp-for="ChangePassword.NewPasswordConfirm" class="form-control" type="password" />
                <span asp-validation-for="ChangePassword.NewPasswordConfirm" class="text-danger"></span>
            </div>
            <div class="form-group">
                <span class="text-success">@Model.Message</span>
            </div>
            <div class="form-group" style="text-align:right">
                @*<input type="submit" value="변경" class="btn btn-warning" />*@
                <a href="javascript:document.getElementById('form').submit()" class="btn btn-warning"><span class="glyphicon glyphicon-floppy-disk"></span> 변경</a>
                <input type="submit" hidden="hidden" />
            </div>
        </form>
        <hr />
    </div>
</div>
<div>
    <a asp-page="Index">홈으로 이동</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
