简体   繁体   中英

Displaying images from wwwroot folders in ASP.net

I am new to ASP.net core. I created a web application for a clothes store that allows users to create a new product and store it in the database. 在此处输入图像描述

在此处输入图像描述

I created an images folder in wwwroot folder. I stored a bunch of images in this image folder. What I am trying to do is to display each images for each product in the index page and the detail page as well. How do i do that?

Index page在此处输入图像描述 Detail page在此处输入图像描述

在此处输入图像描述

"wwwroot" can be accessed by URL.
(eg https://localhost:44374/image/image.png)

If you have the URL address of the image,
Images can be displayed via the "img" tag.

Create an "ImageUrl" field in "class Cloth",
Save the url of the image.

Now, just put the saved url in the 'img' tag.
How to use img tag here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM