如何实现windows 验证不成功后跳转1. web.comfig
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>2. Global.asax.csprivate void WindowsAuthentication_Authenticate(Object sender, WindowsAuthenticationEventArgs e)
{
if (e.Identity.IsAuthenticated)
{
Response.Write (e.Identity.Name);
}
else
{
// 这句从未执行
Response.Redirect ("../Extranet");
}}
Application_AuthenticateRequest ()
{
if (User.Identity.IsAuthenticated)
{
Response.Write (User.Identity.Name);
}
else
{
// 这句从未执行
Response.Redirect ("../Extranet");
}
}
Application_AuthorizeRequest()
{
//... 同上
}以上写法在验证通不过时(如外部用户登录)都弹出windows登陆对话框, 能否像Forms验证那样,直接跳到别的页面,不要弹出windows登陆对话框呢?Thanks!
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>2. Global.asax.csprivate void WindowsAuthentication_Authenticate(Object sender, WindowsAuthenticationEventArgs e)
{
if (e.Identity.IsAuthenticated)
{
Response.Write (e.Identity.Name);
}
else
{
// 这句从未执行
Response.Redirect ("../Extranet");
}}
Application_AuthenticateRequest ()
{
if (User.Identity.IsAuthenticated)
{
Response.Write (User.Identity.Name);
}
else
{
// 这句从未执行
Response.Redirect ("../Extranet");
}
}
Application_AuthorizeRequest()
{
//... 同上
}以上写法在验证通不过时(如外部用户登录)都弹出windows登陆对话框, 能否像Forms验证那样,直接跳到别的页面,不要弹出windows登陆对话框呢?Thanks!
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/MixedSecurity.asp