MVC下设置默认页为index.html

将RouteConfig代码修改为如下

    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapMvcAttributeRoutes();

            routes.MapRoute(
                name: "Home",
                url: "{controller}/{action}",
                defaults: "index"
            );
        }
    }

随后打开IIS管理器中的默认文档功能

将index.html移至第一个即可

posted @ 2015-12-25 09:57  Varorbc  阅读(750)  评论(0编辑  收藏  举报