62,047
社区成员
发帖
与我相关
我的任务
分享
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Paging", // Route name
"{controller}/{action}/{id}/page{pageIndex}",
new { pageIndex = 1 }
);
}
routes.MapRoute(
"Default", // 路由名称
"{controller}/{action}/{id}", // 带有参数的 URL
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // 参数默认值
);
Global.asax 你这里修改了没???这个默认浏览就是http://localhost:3210/Home/Index
<system.webServer>
。。。。。。
<defaultDocument>
<files>
<add value="ShareTracking.aspx" />
</files>
</defaultDocument>
</system.webServer>
2.IIS 配置
IIS7中,左键点你的站点,右边功能菜单中有"默认文档"这一功能(英文版Default Document),双击进去之后添加你的起始页。