To make it easier for users to get to a section of our site, we created a virtual directory alias which redirects the user to a specific web page. If there's no virtual directory for http://www.mysite.com/subdirectory/webpage.aspx
, then that Master Page reference works fine. But once I created a virtual directory and attempted to get to that same page by typing the path to the virtual directory (http://www.mysite.com/subdirectory
), I received this error message relating to the web page trying to access our site's Master Page, which is located in the root of the site:
Server Error in '/subdirectory' Application.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The file '/subdirectory/MasterPage.master' does not exist.
Line 1: <%@ Page Language="VB
" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" EnableSessionState="true" EnableViewState="false" Title="Web Page" %>
Source File: /subdirectory/webpage.aspx Line: 1
I've tried changing the "~/MasterPage.master" reference to "./MasterPage.master" (one period), "../MasterPage.master" (two periods), "/MasterPage.master" (no tilde before slash), and "MasterPage.master" (just the file name) to no avail! Does anyone here know how I can fix this?
These are two sites that contain steps on what we did:
(under "Virtual Directories")
(under "How to create the virtual directory on the web server")