4. Views 폴더의 CommunityCamp 폴더에 Delete.cshtml이라는 이름으로 뷰 페이지를 생성하고, 다음과 같이 코드를 작성한다.
▼ /Views/CommunityCamp/Delete.cshtml
@using DotNetNote.Models
@{
ViewData[“Title”] = “커뮤니티 캠프”;
}
@model CommunityCampJoinMember
<h2>등록 취소하기</h2>
@section Scripts {
@{ await Html.RenderPartialAsync(”_ValidationScriptsPartial”); }
}
<div class=“lead”>
등록을 취소하려면 처음 입력하신 내용을 입력 후 삭제 버튼을 클릭하세요.
</div>
<form asp-controller=“CommunityCamp” asp-action=“Delete” method=“post”
class=“form-horizontal”>
<div asp-validation-summary=“ModelOnly”></div>
<div class=“form-group”>
<label asp-for=“CommunityName” class=“col-sm-2 control-label”></label>
<div class=“col-sm-10”>
<select asp-for=“CommunityName” class=“form-control”>
<option value=“ASP.NET Korea”>ASP.NET Korea</option>
<option value=“Taeyo.NET”>Taeyo.NET</option>
</select>
</div>
</div>
<div class=“form-group”>
<label asp-for=“Name” class=“col-sm-2 control-label”></label>
<div class=“col-sm-10”>
<input asp-for=“Name” class=“form-control” />
<span asp-validation-for=“Name” class=“text-danger”></span>
</div>
</div>
<div class=“form-group”>
<label asp-for=“Mobile” class=“col-sm-2 control-label”></label>
<div class=“col-sm-10”>
<input asp-for=“Mobile” class=“form-control” />
<span asp-validation-for=“Mobile” class=“text-danger”></span>
</div>
</div>
<div class=“form-group”>
<label asp-for=“Email” class=“col-sm-2 control-label”></label>
<div class=“col-sm-10”>
<input asp-for=“Email” class=“form-control” />
<span asp-validation-for=“Email” class=“text-danger”></span>
</div>
</div>
<div class=“form-group”>
<div class=“col-md-offset-2 col-md-10”>
<input type=“submit” name=“btnSave” value=“삭제”
class=“btn btn-primary btn-lg” />
<a asp-controller=“CommunityCamp” asp-action=“Index”
class=“btn btn-default btn-sm”>리스트</a>
</div>
</div>
</form>
@if (ViewBag.Result != null)
{
<div>
@ViewBag.Result
</div>
}