当我加载新网站时,其中一些使用MVC,另一半使用静态页面。
第一页应该是index.html
但是,当我转到http://domain时,它将直接进入MVC Controller 。
即使我有IIS指向此页面,它也不会转到index.html,这可能是由于我使用IIS内部的通配符这一事实,如我的博客http://www.bryanavery.co.uk/post/2009/07/02/Deploying-MVC-on-IIS-6.aspx所述。
但是,当我选择http://domain时,我需要第一页转到index.html。
有任何想法吗?
最佳答案
您可以将路径定向到 Controller 操作并返回文件,如下所示:
public ActionResult Index()
{
return File("index.html", "text/html");
}
关于asp.net-mvc - 想要使用来自mvc的index.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1715015/