我有一个回调方法,它只在容器控件中加载自定义用户控件,我在页面中使用表单身份验证,并将用户身份验证信息存储在我的页面用户身份Page.User.Identity
中
我还使用Global.asax
事件存储页面用户信息:
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
//Get Forms Identity From Current User
}
else
{
//redirect to login.aspx page
}
}
现在,当我调用该回调方法并且用户未经过身份验证时,回调不会触发,而是在global.asax
上一个事件中触发的唯一代码。
从那个事件我需要重定向到login.aspx
页面,我该如何实现?