0

我在 webconfig 和 rout 配置中使用 set as sate as start page

我的网络配置代码是

<forms loginUrl="~/Account/Login" defaultUrl="~/Account/Login" timeout="30" protection="All" /> 

还有我的 Rout Config 代码

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");    
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
            );
        }

现在我在http://epstechno.com/schoolbriefcase/中输入网站网址。它重定向到登录页面。但是这次我想去http://epstechno.com/schoolbriefcase/Account/Login完整的网址。不想只是http://epstechno.com/schoolbriefcase/

我怎样才能做到这一点 ?

4

1 回答 1

0
  public static void RegisterRoutes(RouteCollection routes)
    {
       routes.IgnoreRoute("{resource}.axd/{*pathInfo}");    
        routes.MapRoute(
            name: "Default",
            url: "{YourStartUpContollerName}/{Action(ByDefaultIndex)}/{id}",
            defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
        );
    }
于 2013-09-25T05:07:12.023 回答