asp.net-mvc – 将index.html设置为默认页面
发布时间:2020-05-25 04:09:43 所属栏目:asp.Net 来源:互联网
导读:我有一个空的ASP.NET应用程序,我添加了一个index.html文件。我想将index.html设置为网站的默认页面。 我试图右键单击index.html并设置为起始页,当我运行它时,url是:http:// localhost:5134 / index.html但是我真正想要的是当我键入:http: // localhos
|
我有一个空的ASP.NET应用程序,我添加了一个index.html文件。我想将index.html设置为网站的默认页面。 我试图右键单击index.html并设置为起始页,当我运行它时,url是:http:// localhost:5134 / index.html但是我真正想要的是当我键入:http: // localhost:5134,它应该加载index.html页面。 我的路由配置: public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",url: "{controller}/{action}/{id}",defaults: new { controller = "Home",action = "Index",id = UrlParameter.Optional }
);
}
}
解决方法我添加了一条指令给我的路由配置,以忽略空路由,这解决了我的问题。routes.IgnoreRoute(""); (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET MVC Razor:三元
- asp.net – 无法从HRESULT加载文件或程序集异常:0x8013104
- asp.net-mvc – 在MVC Web应用程序中的存储库中共享DbConte
- asp.net-mvc-3 – ModelState.AddModelError不显示在我的视
- ASP.NET用户名更改
- asp.net – 如何在MVC 5中为OwinContext设置TimeOut
- asp.net-mvc-3 – MVC3非顺序索引和DefaultModelBinder
- asp.net – System.Web.HttpException:请求超时
- asp.net – Visual Studio 2008,2010或2012(v11)是否写入使
- asp.net – 将machineKey添加到machine.config
推荐文章
站长推荐
- asp.net – Sys.WebForms.PageRequestManagerSer
- asp.net-mvc – 为多语言ASP.NET MVC Web应用程序
- 体系结构设计良好的ASP.NET WebForms站点示例
- asp.net – ListView与DataPager不工作
- ASP.NET Core 2.0中Razor页面禁用防伪令牌验证
- asp.net – 如何传递datetime参数?
- asp.net-core – 为什么要在ASP.NET Core中使用完
- asp.net – 允许服务器/ usercontrol上的任何属性
- ef-code-first – 如何通过使用Identity ASP.NET
- asp.net – 在集成模式下替换HttpContext.Curren
热点阅读
