Mark Tabor

Mark Tabor

  • 586
  • 2k
  • 464.6k

showing images in MVC 5

Apr 16 2019 9:16 AM
Hi I have a layout.cshmtl and in that i have a code for showing logo 
<div class="logo_image"><div><img src="images/logo.png" alt=""></div></div>
this works fine but now i am creating another layout2 page and i give another index2 view and set its layout to layout2.cshtml 
but with using the same code <div class="logo_image"><div><img src="images/logo.png" alt=""></div></div>
it shows 404 and on console it is taking the image as 
http://localhost:57789/Home/Images/Pakeeza.png
 
on first page where it is working it did not take the Home link in url what is the issue   
even this is also not working 
<div class="logo">
<a href="#"><img src="@Url.Content("images/Pakeeza.PNG")" alt=""></a>
</div>
 

Answers (5)