2014-10-03 16 views

回答

0

这在Identity中是不存在的。

但是当你做身份的配置,你做这样的东西在Auth.Config.cs

 app.UseCookieAuthentication(new CookieAuthenticationOptions 
     { 
      AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, 
      LoginPath = new PathString("/Account/Login"), 

      // other stuff 
     } 

LoginPath属性集?那就是现在与FormsAuthentication.DefaultUrl工作方式相同的重定向地址,只有您没有在web.config中指定它。

+0

我该如何在代码中调用重定向? – 2014-10-04 00:13:08

+0

只需将路径分配给公共常量并在需要时重新使用 – trailmax 2014-10-04 07:21:55