设置ASP.NET MVC4.5站点默认页为html页

    xiaoxiao2025-02-04  18

    只需在Global.asax.cs文件中增加以下即可,无需在IIS默认文档设置默认html页面。

    protected void Application_BeginRequest(object sender, EventArgs e) {     if (Context.Request.FilePath == "/") 

    Context.RewritePath("index.htm");

    }

    转载请注明原文地址: https://ju.6miu.com/read-1296080.html
    最新回复(0)