MVC的URL是通过路由映射的,因为我们可以通过修改RouteConfig来改变应用的起始页面。
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 = "Admin", action = "Login", id = UrlParameter.Optional }
).DataTokens.Add("Area", "UserManage");
}
}