2013-06-04 16 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