Reputation: 359
Here is my code (part of the Index.cshtml file):
<div class="col-md-6">
<h2>Warunki wypozyczenia</h2>
<p>
Kazdego wypozyczajacego obowiazuja jednakowe zasady dotyczace wypozyczonych ksiazek. <br />Najwazniejsze z nich:
<ol>
<li>Nie jedz z ksiazka.</li>
<li>Myj rece przed czytaniem.</li>
<li>Nie kap sie z ksiazka.</li>
<li>Jesli jestes strazakiem, zostaw ksiazke w bazie przed akcja ratunkowa.</li>
</ol>
</p>
<img src="~\Content\DataTables\images\rules.png" alt="Rules" />
</div>
This is project structer:
In the code, when I mouseover it, image shows up:
On the site there is error:
I have tried refactoring path to this file but nothing helped.
Any ideas?
Upvotes: 0
Views: 64
Reputation: 37
Change this line of code
<img src="~\Content\DataTables\images\rules.png" alt="Rules" />
to
<img src="~\Content\DataTables\images\rules.jpg" alt="Rules" />
You need to consider the extension in you image. "png", "jpg"
hope that helps
Upvotes: 3
Reputation: 7601
are you using \
instead of /
?
correct way is
<img src="~/Content/DataTables/images/rules.png" alt="Rules" />
Upvotes: 2