JackofAll
JackofAll

Reputation: 537

Images on aspx pages with Master Page

I have one master page, in short there are two images on the master page (a logo at the top, and a fb link at the bottom).

I do however have an admin folder for the .aspx pages for when admin log in.

All non-admin pages need to access these two images with the src of image/logo.jpg and image/fb.jpg. However the admin pages need to access the image with the src of /image/logo.jpg and /image/fb.jpg.

Is it possible to achieve two separate paths depending on the folder, without having to create a second master page?

Upvotes: 0

Views: 714

Answers (2)

Emad Feiz
Emad Feiz

Reputation: 1575

use Image Server control instead of html img tag or ResolveUrl method to handle generated url:

<img src='<%= ResolveUrl("~/images/yourimage.png") %>' /> 

Upvotes: 1

Irfan TahirKheli
Irfan TahirKheli

Reputation: 3662

<img src="/images/yourimage.png" /> 

Upvotes: 1

Related Questions