@model CountryRequest
@* Generated from Custom MVC Template. *@
@* Model namespace using directive should be added to _ViewImports.cshtml. *@
@{
var containerDivClass = "container"; // "container-fluid" can be used for full width
var dateTimePickerClass = "datetimepicker"; // "jquery-datetimepicker" must be added as client side library
}
@{
/*
ViewBag and ViewData are the same collection (dictionary).
They carry extra data other than the model from a controller action to its view, or between views.
The value assigned will be shown in Views\Shared\_Layout.cshtml view's title tag of the head tag.
*/
ViewData["Title"] = "Country Edit";
}
<div class="@containerDivClass">
<h1>@ViewData["Title"]</h1>
<hr />
</div>
@if (Model is not null)
{
<div class="@containerDivClass">
@if (TempData["Message"] is not null)
{
/*
TempData is used to carry extra data to the redirected controller action's view.
*/
<p class="text-danger">
@TempData["Message"]
</p>
}
<form asp-action="Edit" autocomplete="off">
@Html.AntiForgeryToken()
<div asp-validation-summary="All" class="text-danger"></div> @* Use ModelOnly instead of All to see only service response messages in validation summary *@
<div class="row mb-3">
<label asp-for="CountryName" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<input asp-for="CountryName" class="form-control" />
<span asp-validation-for="CountryName" class="text-danger"></span>
</div>
</div>
<input type="hidden" asp-for="Id" />
@* Can be uncommented and used for many to many relationships, "entity" may be replaced with the related entity name in the controller and views. *@
@*
<div class="row mb-3">
<label asp-for="EntityIds" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<select multiple asp-for="EntityIds" class="form-select" asp-items="ViewBag.EntityIds"></select>
<span asp-validation-for="EntityIds" class="text-danger"></span>
</div>
</div>
*@
<hr />
<div class="row mb-3">
<div class="offset-2 col-10">
<button type="submit" class="btn btn-primary">Save</button>
<button type="reset" class="btn btn-outline-primary">Reset</button>
<a asp-action="Delete" asp-route-id="@Model.Id">Delete</a>
<a asp-action="Index">Back to List</a>
</div>
</div>
</form>
</div>
}
@section Scripts {
@* Can be uncommented to use client-side validation using jQuery instead of server-side validation. *@
@*<partial name="_ValidationScriptsPartial" />*@
}