Last post Oct 24, 2018 02:06 AM by Nan Yu
Oct 24, 2018 01:43 AM|robinsar|LINK
excuse me sir..
i have tried this code <img src="D:/Image/robin.jpg" style="height:150px; width:100px;"> to display my picture from another directory
but it's did not work., could you help me how to display this image, or some references to help me. thank you .
Oct 24, 2018 02:04 AM|some_yahoo|LINK
First of all, images are supposed to be referenced by URL. it's expecting something like <img src="/images/robin.jpg" />
If you expect this page to be viewed anywhere the browser doesn't have your D: drive mapped, you'll need to copy the images to your website folders somewhere and reference them as URLs. Once you add the image(s) to your content folder, you can just drag
the file from your solution explorer into the cshtml file you want to show it on.
If you are just making a site for people with direct access to your D drive, then you can reference it as a file: <img src="file:///D:/image/robin.jpg" />
Oct 24, 2018 02:06 AM|Nan Yu|LINK
Hi robinsar ,
Even use absolute path to load image , usually the absolute path is from your root web directory , the <img src> must refer a public web URL, not a local disk file system path. Your images have to be available by a HTTP request :