473,607 Members | 2,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master Pages and Absolute Image URI's in HTML

Hi Guys

I have an ASP.NET project with a rough layout as shown below
Default.aspx
Login.aspx
Site.master
web.config
/IMAGES/Image1.jpg
/Image2.jpg
/Image3.jpg ...
/Secure/SecurePage1.asp x
/SecurePage2.asp x
/SecurePage3.asp x
/web.config
Loads of stuff left out, but that is the gist of it. All pages use the
Master Page, There are password protected pages held within the /Secure
folder.

Problem:

My master page uses HTML that includes bith <IMGtags and Java Script
that manipulates the images in the /Images folder.

I cannot get the SRC attrbiute of the <IMGtag to give me an image
that will display for both the "Default.as px" and "SecurePage1.as px".

My <IMGtags look something like (Code from memory, not cut/paste)

<IMG src="/Images/image1.jpg" ... />

It seems that when I use the URI specification

<IMG src="Images/image1.jpg" ... />

The image is displayed in the Default.aspx only. But if I change it to
<IMG src="/Images/image1.jpg" ... />

the image is not displayed in the Default.aspx OR any of the pages in
the Secure folder.

I read that putting the "/" at the start will set the URI to be
relative to the root of the site, but I just cannot seem to get this to
work.

Could anyone point me in the direction of what may be my problem please
?

kind regards

Mike.

p.s.

There are NO ASP.NET Image Server side controls, it is all basic HTML
as spat out from Photoshop/GoLive. I would like this to remain if
possible, with just a minor URI change for the images.

Nov 30 '06 #1
3 4035
Hey, try this:

<IMG src="<%= Page.ResolveUrl ("~")%>/Images/image1.jpg" ... />

On 30 Nov 2006 00:52:06 -0800, Ad**********@go oglemail.com wrote:
>?Hi Guys

I have an ASP.NET project with a rough layout as shown below
Default.aspx
Login.aspx
Site.master
web.config
/IMAGES/Image1.jpg
/Image2.jpg
/Image3.jpg ...
/Secure/SecurePage1.asp x
/SecurePage2.asp x
/SecurePage3.asp x
/web.config
Loads of stuff left out, but that is the gist of it. All pages use the
Master Page, There are password protected pages held within the /Secure
folder.

Problem:

My master page uses HTML that includes bith <IMGtags and Java Script
that manipulates the images in the /Images folder.

I cannot get the SRC attrbiute of the <IMGtag to give me an image
that will display for both the "Default.as px" and "SecurePage1.as px".

My <IMGtags look something like (Code from memory, not cut/paste)

<IMG src="/Images/image1.jpg" ... />

It seems that when I use the URI specification

<IMG src="Images/image1.jpg" ... />

The image is displayed in the Default.aspx only. But if I change it to
<IMG src="/Images/image1.jpg" ... />

the image is not displayed in the Default.aspx OR any of the pages in
the Secure folder.

I read that putting the "/" at the start will set the URI to be
relative to the root of the site, but I just cannot seem to get this to
work.

Could anyone point me in the direction of what may be my problem please
?

kind regards

Mike.

p.s.

There are NO ASP.NET Image Server side controls, it is all basic HTML
as spat out from Photoshop/GoLive. I would like this to remain if
possible, with just a minor URI change for the images.
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 30 '06 #2
Thanks mate,

that works OK for the <IMGTags, but I also have Javascript
manipulating the images and the <% construct does not work in there.

Mike
Rad [Visual C# MVP] wrote:
Hey, try this:

<IMG src="<%= Page.ResolveUrl ("~")%>/Images/image1.jpg" ... />

On 30 Nov 2006 00:52:06 -0800, Ad**********@go oglemail.com wrote:
?Hi Guys

I have an ASP.NET project with a rough layout as shown below
Default.aspx
Login.aspx
Site.master
web.config
/IMAGES/Image1.jpg
/Image2.jpg
/Image3.jpg ...
/Secure/SecurePage1.asp x
/SecurePage2.asp x
/SecurePage3.asp x
/web.config
Loads of stuff left out, but that is the gist of it. All pages use the
Master Page, There are password protected pages held within the /Secure
folder.

Problem:

My master page uses HTML that includes bith <IMGtags and Java Script
that manipulates the images in the /Images folder.

I cannot get the SRC attrbiute of the <IMGtag to give me an image
that will display for both the "Default.as px" and "SecurePage1.as px".

My <IMGtags look something like (Code from memory, not cut/paste)

<IMG src="/Images/image1.jpg" ... />

It seems that when I use the URI specification

<IMG src="Images/image1.jpg" ... />

The image is displayed in the Default.aspx only. But if I change it to
<IMG src="/Images/image1.jpg" ... />

the image is not displayed in the Default.aspx OR any of the pages in
the Secure folder.

I read that putting the "/" at the start will set the URI to be
relative to the root of the site, but I just cannot seem to get this to
work.

Could anyone point me in the direction of what may be my problem please
?

kind regards

Mike.

p.s.

There are NO ASP.NET Image Server side controls, it is all basic HTML
as spat out from Photoshop/GoLive. I would like this to remain if
possible, with just a minor URI change for the images.
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 30 '06 #3
Maybe if you could post an example of the javascript....

On 30 Nov 2006 12:35:43 -0800, Ad**********@go oglemail.com wrote:
>Thanks mate,

that works OK for the <IMGTags, but I also have Javascript
manipulating the images and the <% construct does not work in there.

Mike
Rad [Visual C# MVP] wrote:
>Hey, try this:

<IMG src="<%= Page.ResolveUrl ("~")%>/Images/image1.jpg" ... />

On 30 Nov 2006 00:52:06 -0800, Ad**********@go oglemail.com wrote:
>?Hi Guys

I have an ASP.NET project with a rough layout as shown below
Default.aspx
Login.aspx
Site.master
web.config
/IMAGES/Image1.jpg
/Image2.jpg
/Image3.jpg ...
/Secure/SecurePage1.asp x
/SecurePage2.asp x
/SecurePage3.asp x
/web.config
Loads of stuff left out, but that is the gist of it. All pages use the
Master Page, There are password protected pages held within the /Secure
folder.

Problem:

My master page uses HTML that includes bith <IMGtags and Java Script
that manipulates the images in the /Images folder.

I cannot get the SRC attrbiute of the <IMGtag to give me an image
that will display for both the "Default.as px" and "SecurePage1.as px".

My <IMGtags look something like (Code from memory, not cut/paste)

<IMG src="/Images/image1.jpg" ... />

It seems that when I use the URI specification

<IMG src="Images/image1.jpg" ... />

The image is displayed in the Default.aspx only. But if I change it to
<IMG src="/Images/image1.jpg" ... />

the image is not displayed in the Default.aspx OR any of the pages in
the Secure folder.

I read that putting the "/" at the start will set the URI to be
relative to the root of the site, but I just cannot seem to get this to
work.

Could anyone point me in the direction of what may be my problem please
?

kind regards

Mike.

p.s.

There are NO ASP.NET Image Server side controls, it is all basic HTML
as spat out from Photoshop/GoLive. I would like this to remain if
possible, with just a minor URI change for the images.
--

Bits.Bytes.
http://bytes.thinkersroom.com
--

Bits.Bytes.
http://bytes.thinkersroom.com
Dec 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3718
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank text boxes how do I stop this and how would I code it to redirect to a thank you page. All with out the help of a web server this has to br ran from the desktop and with in IE with a local directory. Pleas help I am stuck. here is the code! ...
5
1715
by: Nalaka | last post by:
Hi, When an image is put on a master page... the url to th eimage is set relatve to the master page. (at least don't know how top set an absolute URL to image) But the when a content page is shown, all images (inclding masterpage) are resoved relative to the content page location. get get around this I copy all master page images to the sub folders too......
1
2215
by: anony | last post by:
Hello, I'm converting a 1.1 app to 2.0 and decided to try out master pages. My menu system consists of images with onmouseover/out events to highlight selected menu items, and to display submenus. These events are attached to javascript functions which rely on the image id to appropately locate and swap images, display submenus at the right location, etc. Anyways, this worked fine initially in 2.0, but when I introducted master...
2
6970
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
6
1870
by: Ben Fidge | last post by:
Hi I've just created a new Master Page for my site and it uses the native Menu control. Strange behaviour is happening on page that use the master page. For some reason, the menu controls rendering is totally out. Instead of nice "fly-out" menu's, the menus are all dumped underneath the static level menu items when the page first loads. Hovering the mouse over one of the static items re-renders the menu as it should look, but then the...
8
6682
by: JT | last post by:
Hi, I have done a fair amount of style editing inline in ASP. I'm now using VS 2005 with a standard web project (not Web Application Project). This is my first foray into CSS in a style sheet and also my first true attempt at using master pages. I tried setting up a style sheet with a simple setting to float an image to the right and it had no effect on the image. Then, I tried putting the style code in my ASPX file as such,
16
1895
by: IfThenElse | last post by:
Hi, I have a web page in a subfolder that inherits a Master page at the root. the webpage in the subfolder can not see the Master page. This is what I have in my webPageThatIsInSubfolder.aspx MasterPageFile="~/myMasterPage.Master" Tried,
5
1514
by: =?Utf-8?B?QW50?= | last post by:
Hi, I'm a newbie to the Master page. When i drag an image directly onto the master page from say my image folder, it is reflected in all pages which use it, however, if I drag a table, layout, image control etc onto the master page, I don't see these added to any of the pages that is using the Master page as a template even after I save & rebuild. Is this expected bahaviour & if so, how do I set up say, menus using a layout or table &...
1
1324
by: raghulvarma | last post by:
I have created a master page <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body>
0
8049
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7985
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8463
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8322
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5997
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3953
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4013
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.