Re: sharing master page question



I tried both and they didn't work in both browsers. Maybe my PC is
possessed! :-x

"clintonG" <nobody@xxxxxxxxxxx> wrote in message
news:OCBVfNJuIHA.1236@xxxxxxxxxxxxxxxxxxxxxxx
The root path operator will function with anything marked runat="server"

"Nathan Sokalski" <njsokalski@xxxxxxxxxxx> wrote in message
news:%23cjcpq6tIHA.2208@xxxxxxxxxxxxxxxxxxxxxxx
Is there any URL you can enter directly into the address bar that is the
URL of the file (such as http://localhost:49646/resources/banner.jpg)
that will display the image? If there is, what is it? Did you
double-check to make sure the file is really where you think it is?
(NOTE: The ~/path/ technique only works with server-side controls, so it
would not work with the img tag example you included)
--
Nathan Sokalski
njsokalski@xxxxxxxxxxx
http://www.nathansokalski.com/

"Cirene" <cirene@xxxxxxxxxxx> wrote in message
news:OHucxX5tIHA.2208@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for the info.

I tried both ~/path/ and /path/ and in IE and Firefox it shows up as a
emtpy box with a x in it.

Actual html image portion was as follows...
<img alt="My Picture" src="/resources/banner.jpg" width="780"
height="124" />

Any ideas? Thanks!

"Nathan Sokalski" <njsokalski@xxxxxxxxxxx> wrote in message
news:OHSL8N5tIHA.5268@xxxxxxxxxxxxxxxxxxxxxxx
You are obviously using relative URLs in your code, which is good, but
when files in different directories are involved in the same page, it
is good to make sure they will all work for that page (and all pages
they are used in). Here are a few ideas that may help:

1. For directories that are used by almost all pages (and Master pages
and UserControls), such as an /images/ directory for example, it is
good to write it as /images/ rather than images/ so that it is relative
to the root instead of the current directory. This will save you the
trouble of needing to worry about whether to use the directory of the
Page, Master Page, UserControl, CSS file, JavaScript file, etc.

2. For any server controls, you can use ~/path/ The ~ represents the
root of the site. For more details on this, see the documentation.

Even though this may sometimes make your URLs longer than is always
absolutely necessary, it can usually save you a lot of trouble and make
it easier to modify code later in development. Hopefully some of this
helps.
--
Nathan Sokalski
njsokalski@xxxxxxxxxxx
http://www.nathansokalski.com/

"Cirene" <cirene@xxxxxxxxxxx> wrote in message
news:udPiy72tIHA.5096@xxxxxxxxxxxxxxxxxxxxxxx
I have 1 master page in the root of my website that I would like to
share with all pages, even those in my /admin and /client directories.
But when pages in the subdir's are viewed the img, css, etc...
references are incorrect because they are "root based". Any suggestion
as to how to overcome this? Or do I have to create another Master Page
for the subdir pages?

Thansk!










.



Relevant Pages

  • Re: sharing master page question
    ... Nathan Sokalski ... For directories that are used by almost all pages (and Master ... relative to the root instead of the current directory. ... directory of the Page, Master Page, UserControl, CSS file, JavaScript ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sharing master page question
    ... Nathan Sokalski ... For directories that are used by almost all pages (and Master pages ... relative to the root instead of the current directory. ... of the Page, Master Page, UserControl, CSS file, JavaScript file, etc. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sharing master page question
    ... needing to worry about whether to use the directory of the Page, Master ... Page, UserControl, CSS file, JavaScript file, etc. ... it can usually save you a lot of trouble and make ... incorrect because they are "root based". ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sharing master page question
    ... needing to worry about whether to use the directory of the Page, Master ... Page, UserControl, CSS file, JavaScript file, etc. ... it can usually save you a lot of trouble and make it ... incorrect because they are "root based". ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: sharing master page question
    ... You are obviously using relative URLs in your code, which is good, but when ... This will save you the trouble of needing ... to worry about whether to use the directory of the Page, Master Page, ... UserControl, CSS file, JavaScript file, etc. ...
    (microsoft.public.dotnet.framework.aspnet)