Re: sharing master page question
- From: "Nathan Sokalski" <njsokalski@xxxxxxxxxxx>
- Date: Fri, 16 May 2008 16:29:01 -0400
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!
.
- Follow-Ups:
- Re: sharing master page question
- From: Cirene
- Re: sharing master page question
- References:
- sharing master page question
- From: Cirene
- sharing master page question
- Prev by Date: Loading a password field when editing a user.
- Next by Date: Re: sharing master page question
- Previous by thread: sharing master page question
- Next by thread: Re: sharing master page question
- Index(es):
Relevant Pages
|
Loading