Adding Image in html

前端 未结 3 1579
南旧
南旧 2021-01-27 11:13

I cannot seem to add an image in html. I\'m using ASP.net MVC 3. My image, named KeyLargoPic, is located on a flash drive in the folder X:\\Project\\Project\\Photos\\Key Largo

相关标签:
3条回答
  • 2021-01-27 11:35

    Add the image to your project, probably in the content directory, by right clicking the directory and clicking "Add" then "Existing Item", browse to your jpeg and click "Add". With your image now part of the project you can add it to the webpage like so:

    <td><img src="@Url.Content("~/Content/KeyLargoPic.jpg")" alt="IMAGE"></td>
    
    0 讨论(0)
  • 2021-01-27 11:41

    Try to mount a virtual directory in IIS pointing to X:\Project[...] so you will be able to access your ressources with a relative address

    0 讨论(0)
  • 2021-01-27 11:47

    Upload the image to your web server and reference via web path from your project. The web server can't read from your usb drive.

    0 讨论(0)
提交回复
热议问题