5. Views 폴더의 User 폴더에 회원 가입을 처리하는 뷰 페이지인 Register.cshtml 페이지를 만들고 다음과 같이 작성한다.
▼ /Views/User/Register.cshtml
@model UserViewModel
@{
ViewData["Title"] = "회원가입";
}
<h2>@ViewData[“Title”].</h2>
<div class=“row”>
<div class=“col-md-8”>
<section>
<form asp-controller=“User” asp-action=“Register” method=“post”
class=“form-horizontal”>
<h4>아래 항목을 입력하시오.</h4>
<hr />
<div asp-validation-summary=“All” class=“text-danger”></div>
<div class=“form-group”>
<label class=“col-sm-2 control-label” asp-for=“UserId”></label>
<div class=“col-sm-6”>
<input type=“text” class=“form-control” asp-for=“UserId”
placeholder=“아이디”>
<span asp-validation-for=“UserId” class=“text-danger”></span>
</div>
</div>
<div class=“form-group”>
<label class=“col-sm-2 control-label” asp-for=“Password”></label>
<div class=“col-sm-6”>
<input type=“password” class=“form-control” asp-for=“Password”
placeholder=“암호”>
<span asp-validation-for=“Password” class=“text-danger”></span>
</div>
</div>
<div class=“form-group”>
<div class=“col-sm-offset-2 col-sm-6”>
<input type=“submit” value=“가입” class=“btn btn-primary btn-lg” />
<a asp-controller=“User” asp-action=“Index”
class=“btn btn-default btn-sm”>취소</a>
</div>
</div>
</form>
</section>
</div>
<div class=“col-md-4”>
</div>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}