昨天剛打完疫苗,沒想到晚上所有症狀通通都來了,整個人爛得跟什麼一樣,有夠慘
今天就把簡單的部分貼一貼,如果要補充之後再說
就是結合 Create 的 POST
和 Details 的 GET
頁面,就不多做說明
前端就用 Create 頁面的複製貼上就好了
功能幾乎在 Scaffold 的時候建好了,這邊就隨便調整前端要顯示的欄位就好
@model OnlineShopCMS.Models.Product
@{
ViewData["Title"] = "Delete";
}
<h1>Delete</h1>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Product</h4>
<hr />
<dl class="row">
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Name)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Name)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Category)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Category.Name)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input type="submit" value="Delete" class="btn btn-danger" /> |
<a asp-action="Index">Back to List</a>
</form>
</div>