2013-06-04 22 views
0

我有一個C#.NET網站我一直在嘗試上傳到虛擬主機提供商的服務器。如果我將網站上傳到我的基本目錄http://www.xyz.org/hello.aspx,我很成功。但是當我嘗試上傳到子目錄http://www.xyz.org/subDir/hello.aspx時,出現以下錯誤消息。我有一種感覺,它與配置文件有關?但我不確定。任何幫助,將不勝感激。將C#項目上載到FTP服務器

Server Error in '/' Application.


Parser Error 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 '/Resume_MasterPage.master' does not exist.

Source Error:

Line 1: <%@ page title="" language="C#" masterpagefile="~/Resume_MasterPage.master" autoeventwireup="true" inherits="HomePage, App_Web_zotcvohv" %>
Line 2: <%@ MasterType VirtualPath="~/Resume_MasterPage.master" %>
Line 3:

回答

1

錯誤來自文件位置的轉換。這一變量例如~

masterpagefile="~/Resume_MasterPage.master"

說,Resume_MasterPage.master位於根,而不是一個子目錄,因爲~被「翻譯」的根路徑時,實際上是在尋找文件。

現在您將其移動到一個子目錄並找不到文件。

我不知道該網站是否實際上在子目錄上工作,但第一步是從所有引用中刪除~,並確保最後在本地工作。也許還有其他一些出現,但實際上這是你的問題。

+0

我會刪除'〜'還是會在路徑名中添加子目錄...'〜/ subdir/Resume_MasterPage.master' – Chris

+0

第1行:<%@ master language =「C#」autoeventwireup =「true」第3行:<!DOCTYPE html PUBLIC「 - // W3C // DTD XHTML 1.0 Transitional // EN」「http://www.w3.org/TR/xhtml1/DTD/xhtml1 -transitional.dtd「> 源文件:/cs/Resume_MasterPage.master行:1 不幸的是仍然收到錯誤消息 – Chris

+0

@Chris做一個測試 - 如果你只是刪除它,你必須把它們放在同一個目錄。錯誤信息 ?什麼錯誤? – Aristos