我使用set as sate作为webconfig中的起始页面和rout config
我的网络配置代码是
<forms loginUrl="~/Account/Login" defaultUrl="~/Account/Login" timeout="30" protection="All" />
我的Rout配置代码
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/
我该怎么做?
答案 0 :(得分: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 }
);
}