PC Review


Reply
Thread Tools Rate Thread

master pages and image URL

 
 
Nalaka
Guest
Posts: n/a
 
      19th Dec 2005
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......

this happens with the .ascx (user controls) too....

is there another soulution to setting up these image urls so that I dont
have to duplicate it.


thanks in advance.
Nalaka


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      19th Dec 2005
Have you tried giving the image url in format such as

"~/images/image.gif"
e.g tilde at start of the path. ~ refers to the root of the web application

For longer explanation, please see:
http://www.aspnetpro.com/newslettera...200311kd_l.asp

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke


"Nalaka" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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......
>
> this happens with the .ascx (user controls) too....
>
> is there another soulution to setting up these image urls so that I dont
> have to duplicate it.
>
>
> thanks in advance.
> Nalaka
>
>



 
Reply With Quote
 
 
 
 
Nalaka
Guest
Posts: n/a
 
      19th Dec 2005
Thanks.. will try

"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Have you tried giving the image url in format such as
>
> "~/images/image.gif"
> e.g tilde at start of the path. ~ refers to the root of the web
> application
>
> For longer explanation, please see:
> http://www.aspnetpro.com/newslettera...200311kd_l.asp
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
>
> "Nalaka" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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......
>>
>> this happens with the .ascx (user controls) too....
>>
>> is there another soulution to setting up these image urls so that I dont
>> have to duplicate it.
>>
>>
>> thanks in advance.
>> Nalaka
>>
>>

>
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      20th Dec 2005
Thanks for Teemu's good suggestion.

Hi Nalaka,

As Teemu has mentioned , the "~/...." path point to the ASP.NET's
application root. So if you're using asp.net server control , we can always
use this style path since it is easy to locate resource.... And for some
cases that we will embeded static html element that'll point to some
resources, we may need to use static path , such as /.../..... which
start from website root (not web app root...) or just reletive path.....

In addition, we can also programmatically embeded asp.net applicaiton root
path in html like:

<img src='<%= ResolveUrl("~/Images/titlebar.gif") %>' />

Hope also helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Nalaka" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
| Subject: Re: master pages and image URL
| Date: Mon, 19 Dec 2005 11:20:28 -0800
| Lines: 47
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365769
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks.. will try
|
| "Teemu Keiski" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Have you tried giving the image url in format such as
| >
| > "~/images/image.gif"
| > e.g tilde at start of the path. ~ refers to the root of the web
| > application
| >
| > For longer explanation, please see:
| >
http://www.aspnetpro.com/newslettera..._l/asp200311kd
_l.asp
| >
| > --
| > Teemu Keiski
| > ASP.NET MVP, AspInsider
| > Finland, EU
| > http://blogs.aspadvice.com/joteke
| >
| >
| > "Nalaka" <(E-Mail Removed)> wrote in message
| > news:(E-Mail Removed)...
| >> 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......
| >>
| >> this happens with the .ascx (user controls) too....
| >>
| >> is there another soulution to setting up these image urls so that I
dont
| >> have to duplicate it.
| >>
| >>
| >> thanks in advance.
| >> Nalaka
| >>
| >>
| >
| >
|
|
|

 
Reply With Quote
 
Nalaka
Guest
Posts: n/a
 
      20th Dec 2005
thanks....
let me try...... <img src='<%= ResolveUrl("~/Images/titlebar.gif") %>' />
imageUrl did not like "~/xxx" directly.

Nalaka



"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:yn%(E-Mail Removed)...
> Thanks for Teemu's good suggestion.
>
> Hi Nalaka,
>
> As Teemu has mentioned , the "~/...." path point to the ASP.NET's
> application root. So if you're using asp.net server control , we can
> always
> use this style path since it is easy to locate resource.... And for some
> cases that we will embeded static html element that'll point to some
> resources, we may need to use static path , such as /.../..... which
> start from website root (not web app root...) or just reletive path.....
>
> In addition, we can also programmatically embeded asp.net applicaiton root
> path in html like:
>
> <img src='<%= ResolveUrl("~/Images/titlebar.gif") %>' />
>
> Hope also helps.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
> --------------------
> | From: "Nalaka" <(E-Mail Removed)>
> | References: <(E-Mail Removed)>
> <(E-Mail Removed)>
> | Subject: Re: master pages and image URL
> | Date: Mon, 19 Dec 2005 11:20:28 -0800
> | Lines: 47
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
> | X-RFC2646: Format=Flowed; Response
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
> | Message-ID: <#(E-Mail Removed)>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet
> | NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl
> microsoft.public.dotnet.framework.aspnet:365769
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> |
> | Thanks.. will try
> |
> | "Teemu Keiski" <(E-Mail Removed)> wrote in message
> | news:(E-Mail Removed)...
> | > Have you tried giving the image url in format such as
> | >
> | > "~/images/image.gif"
> | > e.g tilde at start of the path. ~ refers to the root of the web
> | > application
> | >
> | > For longer explanation, please see:
> | >
> http://www.aspnetpro.com/newslettera..._l/asp200311kd
> _l.asp
> | >
> | > --
> | > Teemu Keiski
> | > ASP.NET MVP, AspInsider
> | > Finland, EU
> | > http://blogs.aspadvice.com/joteke
> | >
> | >
> | > "Nalaka" <(E-Mail Removed)> wrote in message
> | > news:(E-Mail Removed)...
> | >> 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......
> | >>
> | >> this happens with the .ascx (user controls) too....
> | >>
> | >> is there another soulution to setting up these image urls so that I
> dont
> | >> have to duplicate it.
> | >>
> | >>
> | >> thanks in advance.
> | >> Nalaka
> | >>
> | >>
> | >
> | >
> |
> |
> |
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      21st Dec 2005
You're welcome Nalaka,

If anything else we can help, please feel free to post here.

regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Nalaka" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
<#(E-Mail Removed)>
<yn#(E-Mail Removed)>
| Subject: Re: master pages and image URL
| Date: Tue, 20 Dec 2005 09:22:57 -0800
| Lines: 114
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:366022
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| thanks....
| let me try...... <img src='<%= ResolveUrl("~/Images/titlebar.gif") %>' />
| imageUrl did not like "~/xxx" directly.
|
| Nalaka
|
|
|
| "Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
| news:yn%(E-Mail Removed)...
| > Thanks for Teemu's good suggestion.
| >
| > Hi Nalaka,
| >
| > As Teemu has mentioned , the "~/...." path point to the ASP.NET's
| > application root. So if you're using asp.net server control , we can
| > always
| > use this style path since it is easy to locate resource.... And for
some
| > cases that we will embeded static html element that'll point to some
| > resources, we may need to use static path , such as /.../..... which
| > start from website root (not web app root...) or just reletive path.....
| >
| > In addition, we can also programmatically embeded asp.net applicaiton
root
| > path in html like:
| >
| > <img src='<%= ResolveUrl("~/Images/titlebar.gif") %>' />
| >
| > Hope also helps.
| >
| > Regards,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | From: "Nalaka" <(E-Mail Removed)>
| > | References: <(E-Mail Removed)>
| > <(E-Mail Removed)>
| > | Subject: Re: master pages and image URL
| > | Date: Mon, 19 Dec 2005 11:20:28 -0800
| > | Lines: 47
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Response
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <#(E-Mail Removed)>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: m181-9.bctransit.bc.ca 199.60.181.9
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:365769
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Thanks.. will try
| > |
| > | "Teemu Keiski" <(E-Mail Removed)> wrote in message
| > | news:(E-Mail Removed)...
| > | > Have you tried giving the image url in format such as
| > | >
| > | > "~/images/image.gif"
| > | > e.g tilde at start of the path. ~ refers to the root of the web
| > | > application
| > | >
| > | > For longer explanation, please see:
| > | >
| >
http://www.aspnetpro.com/newslettera..._l/asp200311kd
| > _l.asp
| > | >
| > | > --
| > | > Teemu Keiski
| > | > ASP.NET MVP, AspInsider
| > | > Finland, EU
| > | > http://blogs.aspadvice.com/joteke
| > | >
| > | >
| > | > "Nalaka" <(E-Mail Removed)> wrote in message
| > | > news:(E-Mail Removed)...
| > | >> 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......
| > | >>
| > | >> this happens with the .ascx (user controls) too....
| > | >>
| > | >> is there another soulution to setting up these image urls so that I
| > dont
| > | >> have to duplicate it.
| > | >>
| > | >>
| > | >> thanks in advance.
| > | >> Nalaka
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross Page Post Back When Using Mixture of Master Pages and Non-Master Pages Jason@webbit.com Microsoft ASP .NET 1 16th May 2006 03:00 PM
Themes + Picture relative url + Master Pages Roel Microsoft ASP .NET 2 22nd Dec 2005 02:25 PM
redirect URL's, return URL's, and URL Parameters Jon paugh Microsoft ASP .NET 1 10th Jul 2004 06:29 AM
RAID on Master/Master or Master/Slave? no_one Asus Motherboards 4 31st Jan 2004 06:35 AM
How to chage Absolute url to relative url ,and relative url to absolute url gqtang Microsoft C# .NET 1 13th Sep 2003 05:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 PM.