Getting MVC to ignore route to site root

故事扮演 提交于 2019-12-05 03:41:51

I believe what you mean is when someone accesses / on your website, you don't want to use MVC, but show a static page. To achieve this, you need to tell MVC to ignore that route and let webforms handle it. Webforms then should show you /index.html when it gets the request /.

Simply adding this before your routes should work:

routes.IgnoreRoute("");

One of the routes was still in {} which made it try to parse the root.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!