ASP.net - 虚拟路径“/Master.master”映射到另一个应用程序,这是不允许的 [英] ASP.net - The virtual path '/Master.master' maps to another application, which is not allowed
问题描述
我已经位于我的网站的根目录下一个asp.net母版页。我在目录页/ MyFolder文件,从母版页:
I have an asp.net master page located in the root directory of my site. I have a page in the directory "/myfolder" from the master page:
<%@ Page Title="" Language="C#" MasterPageFile="../Master.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="myproject.TimelapseDefault" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<p>
该文件是这样的:
The files look like:
/Master.master
/myfolder/default.aspx
/Master.master /myfolder/default.aspx
为什么我得到这个错误,当我把它上传到我的(非专用GoDaddy的IIS 7)服务器,但它工作在本地主机上?:
分析器错误
说明:该请求提供服务所需资源的分析过程中出现错误。请检查下列特定分析错误详细信息并适当地修改源文件。
Why do I get this error, when I upload it to my (non dedicated godaddy iis 7) server, but it works on localhost?: 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.
分析器错误信息:文件'/timelapserpro/Master.master'不存在
Parser Error Message: The file '/timelapserpro/Master.master' does not exist.
源错误:
1号线:&LT;%@页标题=LANGUAGE =C#的MasterPageFile =〜/ Master.masterAutoEventWireup =真codeBehind =Default.aspx的。 CS继承=myproject.TimelapseDefault%GT;
2号线:&LT; ASP:内容ID =内容1ContentPlaceHolderID =ContentPlaceHolder1=服务器&GT;
结果
3号线:&LT; P&GT;
所有页面都在同一个解决方案。
All pages are in the same solution.
推荐答案
试图改变的MasterPageFile =../ Master.master
到的MasterPageFile =〜/ Master.master
如果您在IIS 7创建虚拟文件夹正确还要检查。检查路径,你的应用程序是正确的。你在你的IIS有这样的文件夹结构
Also check if you create virtual folder on your iis 7 properly. Check if path to your app is correct. You have to have such folder structure in your IIS
->YourAppName (the root of your app contains your root files)
->myfolder (contains your myfolder content)
这篇关于ASP.net - 虚拟路径“/Master.master”映射到另一个应用程序,这是不允许的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!