我在本地IIS服务器中托管了.Net应用程序。我没有管理 MVC 中的错误情况。我将IIS .NET错误用于特定页面的页面重定向。

ASP.Net错误页面显示错误
页面中的EdgeChromeFirefox显示
内容而不是页面。

我的程序如下:

  • Internet信息服务(IIS)管理器
  • mysite> Asp.NET> .Net错误页面
    html - 浏览器呈现的代码而不是页面-LMLPHP

  • 和内容在Error.html

    <html>
    <head>
    Coming Soon
    </head>
    <body>
    <h1>Page Under Construction</h1>
    </body>
    </html>


    MVC 中是否需要页面重定向处理?

    最佳答案

    我不知道您如何称呼重定向页面。

    试试这个(MVC形式的代码):

     public ActionResult Index()
     {
        return View("~/Views/error.cshtml");
     }
    

    关于html - 浏览器呈现的代码而不是页面,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41670025/

    10-12 12:45
    查看更多