【问题标题】:Using Windows Authentication how to redirect all initial request to a specific page使用 Windows 身份验证如何将所有初始请求重定向到特定页面
【发布时间】:2013-03-11 07:14:18
【问题描述】:

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

提前致谢。

【问题讨论】:

标签: c# asp.net windows-authentication form-authentication


【解决方案1】:

我认为您可以使用Global.asax 文件的Session_Start 方法并重定向到您的目标网页。

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

【讨论】:

  • 我不能使用它,因为在某些页面上我禁用了会话。因此,当用户直接点击会话禁用页面时,此代码将不起作用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-07-15
  • 2011-07-01
  • 1970-01-01
相关资源
最近更新 更多