Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用Windows身份验证如何将所有初始请求重定向到特定页面_C#_Asp.net_Windows Authentication_Form Authentication - Fatal编程技术网

C# 使用Windows身份验证如何将所有初始请求重定向到特定页面

C# 使用Windows身份验证如何将所有初始请求重定向到特定页面,c#,asp.net,windows-authentication,form-authentication,C#,Asp.net,Windows Authentication,Form Authentication,我有一个asp.net web应用程序在Windows身份验证模式下运行。我的要求是用户第一次请求的任何页面(URL)(会话开始)都应该重定向到LandingPage.aspx。有人能建议如何使用Windows身份验证将所有初始请求重定向到特定页面(LandingPage.aspx)吗 提前感谢。我认为您可以使用Global.asax文件的会话启动方法,并重定向到您的登录页 void Session_Start(object sender, EventArgs e) { Response

我有一个asp.net web应用程序在Windows身份验证模式下运行。我的要求是用户第一次请求的任何页面(URL)(会话开始)都应该重定向到LandingPage.aspx。有人能建议如何使用Windows身份验证将所有初始请求重定向到特定页面(LandingPage.aspx)吗


提前感谢。

我认为您可以使用
Global.asax
文件的
会话启动方法,并重定向到您的登录页

void Session_Start(object sender, EventArgs e)
{
    Response.Redirect("LandingPage.aspx");
}

看看这个,你不能使用Server.Transfer或Response.Redirect吗?我在Web.Config中尝试了这个,但没有按预期工作,我不能使用这个,因为在某些页面上我禁用了会话。所以,当用户直接点击会话禁用页面时,此代码将无法工作。