想从mvc使用index.html

Cop*_*ill 8 asp.net-mvc iis-6

当我加载我的新网站时,我有一些使用MVC而另一半使用静态页面.

第一页应该是index.html

但是,当我转到http://域时,它直接进入MVC控制器.

它不会转到index.html,即使我有IIS指向此页面,也可能是因为我在IIS中使用通配符,详见我的博客http://www.bryanavery.co .UK /后/ 2009/07/02 /部署-MVC-ON-IIS-6.aspx

但是当我选择http:// domain时,我需要第一页转到index.html

有任何想法吗?

Pau*_*aul 10

您可以将路径指向控制器操作并返回如下文件:

public ActionResult Index()
{
    return File("index.html", "text/html");
}
Run Code Online (Sandbox Code Playgroud)