Images do not appear on the website posted on the web server

Asked

Viewed 963 times

1

Good afternoon, you guys, I published a website on the WEB server, but no image is being displayed in the browser.

All images are displayed this way:

<img src="~/imagens/logo.png"

Local displays normally. But not on the server. I’ve already verified that the images exist in this directory. I have also tried to modify the view code to display the full URL ("http://dominio.com/site/imagens/logo.png"), but it didn’t work either.

The problem is occurring with css. It does not display the site with the correct formatting.

Is there any configuration that should be done in this directory inside the server or in Iss for the images to appear?

I have checked the installation of IIS, on enable or disable windows resources, and static content is enabled.

  • Could you pass the site link ? Or the source code ?

  • http://dev.computecnica.com.br:81/controlehoras

2 answers

1

change to

<img src="@Url.Content("~/imagens/logo.png")" />

From you are using a virtual directory inside the main site on IIS and the way it was ~/ it will search the IIS Root folder

  • Thanks @Pablo vargas Not working

0

In fact you would not need to put the "tilde" before the address, hence the search will be from your base directory, not IIS. Would look like this:

<img src="/imagens/logo.png" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.