SnowmanOnFire
SnowmanOnFire

Reputation: 163

Is there a way to show picture if html has been included in another file

Problem: I have a file called index.html. this file has been included in another file called main.asp.

<!--#include virtual="/template/index.html"-->

index.html has a image tag <img src="abcd.jpg"/> image is in the same directory where index.html resides. ... When this method is being used it is not possible to display the images in index.html which has been included in main.asp.

Upvotes: 0

Views: 44

Answers (2)

gillytech
gillytech

Reputation: 3686

The browser will try to locate assets based on the relative position of the current document.

So you will need to reference the image from the location of main.asp in your file structure, not index.html

Upvotes: 0

Oded
Oded

Reputation: 499212

Use an absolute path in the image src:

<img src="/template/abcd.jpg"/>

Upvotes: 1

Related Questions