Skip to content

Commit

Permalink
Section 16 - Display Image on Update Product Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhrugen Patel committed Mar 24, 2023
1 parent d5a7828 commit f3f7d8a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BulkyWeb/Areas/Admin/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public IActionResult Upsert(int? id)
else
{
//update
productVM.Product = _unitOfWork.Product.Get(u=>u.Id==id);
productVM.Product = _unitOfWork.Product.Get(u=>u.Id==id,includeProperties:"ProductImages");
return View(productVM);
}

Expand Down
10 changes: 8 additions & 2 deletions BulkyWeb/Areas/Admin/Views/Product/Upsert.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@
</div>
</div>
<div class="col-2">
@* <img src="@Model.Product.ImageUrl" width="100%"
style="border-radius:5px; border:1px solid #bbb9b9" />*@
@if (Model.Product.ProductImages != null) {
foreach(var image in Model.Product.ProductImages) {
<div class="border p-1 m-2 text-center">
<img src="@image.ImageUrl" width="100%"
style="border-radius:5px; border:1px solid #bbb9b9" />
</div>
}
}
</div>
</div>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f3f7d8a

Please sign in to comment.