Masterpages & Relative Paths

R

rob

I have a hosting account where my main path is c:\host\members\myname.
On this account I have multiple independent sites. One site is in
c:\host\members\myname\site1, another in c:\host\members\myname\site2,
etc. Basically, each site is in its own subdirectory.

My websites use masterpages. The problem I am having is with the
following line:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="Documentation.aspx.cs"
Inherits="Documentation" Title="Untitled Page" %>

This gives me the error:

"The file '/MasterPage.master' does not exist."

I assume that is because "~/" does refer to the root, i.e.
c:\host\members\myname instead of c:\host\members\myname\site1. Now I
could correct that by replacing "~/" with "~/site1". The problem is
that if I move the page I will have to make this modifications for each
file (and there are many) that contains the above mentioned line. What
is the best solution to solve this problem?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top