我的登录页面具有属性路由。如何在routeconfig中将该页面设置为应用程序的起始页面?
我的RouteConfig
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.LowercaseUrls = true;
routes.MapMvcAttributeRoutes();
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Login", action = "Login", id = UrlParameter.Optional }
);
}
我的控制器:
[Route("Login")]
[HttpGet]
public ActionResult Index()
{
return View();
}
如果我更改了
action = "Login"
收件人
action = "Index"
它仍然不起作用。