尽管在Visual Studio中工作,但在IIS中加载主页错误? [英] Master Page Error Loading in IIS although Working In Visual Studio ?

查看:115
本文介绍了尽管在Visual Studio中工作,但在IIS中加载主页错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序目录中有一个母版页面(App / Masterpage.master)

i am在许多页面中使用此母版页在Visual Studio中没有问题

WHen我发布我的应用程序在IIS上找不到它

例如: -

i Have A master Page in Directory Of Application ( App/Masterpage.master )
i am Using This Master Page In Many pages and no problem in Visual Studio
WHen i Published My Application On IIS its can't found it
For Eg:-

<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpage.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HR.Default" %>



i发现错误


i found error

Parser Error Message: The file '/Masterpage.Master' does not exist.

推荐答案

这是因为它位于App目录下,而不是根目录下。使用〜表示站点的根目录。因此,如果您将App文件夹更改为IIS中的目录,则可以解决此问题。
This is because it is under the App directory, not the root. Using ~ means the root of the site. So, if you changed the App folder to a directory in IIS it would fix this issue.


这篇关于尽管在Visual Studio中工作,但在IIS中加载主页错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆