Search code examples
htmlmodel-view-controller

images are broken on some of the MVC pages


I cannot see the image tec.png on Print.cshtml but same image is visible on PrintBos.cshtml

cshtml files

My image path

Print.cshtml code

<th>
        <img style="
             width:60%;
             "src="..\img\tec.png">
    </th>

printBos.cshtml code

<th>
        <img style="
             width:60%;
             "src="..\img\tec.png">
    </th>

As I can see,they are the same. What might be the reason?

Edit: I realized that images are shown on the default page only and using ~ doesn't work. Image file contents are not encrypted.


Solution

  • I deleted the .. and it worked

     <th>
                <img style="
                     width:60%;
                     "src="\img\tec.png">
            </th>