0

I have deployed a .net application on IIS7. But I am facing an issue with accessing the image even in the Login page. I have a master page that is accessing the image with below code -

<table>
    <tr>
        <td><img id="imgSpacer" src="logo.jpg" runat="Server" alt="spacer"  /></td>
    </tr>
</table>

This image is in the same folder as the master page and works perfectly find in the visual studio.

And help will be greatly appreciated!

Thanks!

1
  • Try publishing locally (to a directory) and see if the image is where you expect it to be. Commented Nov 17, 2013 at 17:22

1 Answer 1

1

Try resolving the path from the root:

<img id="imgSpacer" src="~/logo.jpg" runat="Server" alt="spacer" />
Sign up to request clarification or add additional context in comments.

2 Comments

Should then I also put the image in parent folder? I am asking this because first I had the image in a different folder and accessed it like src="~/Images/logo.jpg" and still it did not work. Please note that the problem here is that it works fine in visual studio when I build and run the application but the problem appears only I have deployed.
Once you resolve the path from the root it will work on both your local machine and the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.