@model StoreRequest
@* 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"] = "Store Create";
}
<div class="@containerDivClass">
<h1>@ViewData["Title"]</h1>
<hr />
</div>
<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="Create" autocomplete="off">
@Html.AntiForgeryToken()
<div asp-validation-summary="ModelOnly" 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="Name" class="col-2 col-form-label fw-bold"></label>
<div class="col-10">
<input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger"></span>
</div>
</div>
<div class="row mb-3">
<label asp-for="IsVirtual" class="col-2 col-form-label fw-bold"></label>
<div class="col-10 pt-2">
<input class="form-check-input" asp-for="IsVirtual" />
</div>
</div>
@* 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="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" />
}