【发布时间】:2013-12-23 08:42:56
【问题描述】:
我在 http://localhost/ 上托管的网站遇到了以下问题,该网站以前托管在 Visual Studio 上。我在 rool 文件夹中创建了文件夹名称 website4 并移动了网站。
然后我得到以下错误。
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 virtual path '/assets/masters/homepage.master' maps to another application, which is not allowed.
Source Error:
Line 1: <%@ Page Language="C#" MasterPageFile="/assets/masters/homepage.master" Title="Content Page 1" %>
Line 2:
Line 3: <asp:Content ContentPlaceHolderID="Extra_dNet_Code" Runat="Server">
Source File: /WebSite4/default.aspx Line: 1
然后我将上面的网址('/assets/masters/homepage.master')更改为以下网址('~/assets/masters/homepage.master')。 之后我收到以下错误
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 virtual path '/assets/stylesheets/css.ascx' maps to another application, which is not allowed.
Source Error:
Line 1: <%@ Master Language="C#" %>
Line 2: <%@ Register Src="/assets/stylesheets/css.ascx" TagName="css" TagPrefix="include" %>
Line 3: <%@ Register Src="/assets/javascripts/scripts.ascx" TagName="scripts" TagPrefix="include" %>
Line 4: <%@ Register Src="/assets/header/header.ascx" TagName="header" TagPrefix="include" %>
Source File: /WebSite4/assets/masters/homepage.master Line: 2
然后我把上面的url改成following
<%@ Register Src="~/assets/stylesheets/css.ascx" TagName="css" TagPrefix="include" %>
<%@ Register Src="~/assets/javascripts/scripts.ascx" TagName="scripts" TagPrefix="include" %>
<%@ Register Src="~/assets/header/header.ascx" TagName="header" TagPrefix="include" %>
但是它开始在没有 javascript 和 css 的情况下运行该网站。 当我单击图像时,它总是将站点重定向到没有 website4 的 URL 之后。类似这个网址的东西
`http://localhost/assets/images/...`
上面的链接应该是
http://localhost/website4/assets/images/...
或者它只是重定向到http://localhost.
如何解决这个问题?
【问题讨论】:
标签: asp.net localhost web-hosting