会话结束后,如何重定向登录表单页面
问题描述:
有人可以告诉我该怎么做吗?
can someone tell me how can do this???
答
在母版页中编写此代码.
write this code in Masterpage.
if (Session["UserName"] != null)
{
//Retrieving UserName from Session
lblWelcome.Text = "Welcome : " + Session["UserName"];
}
else
{
Response.Redirect("Login.aspx");
}
实现表单身份验证.
http://support.microsoft.com/kb/301240 [ ^ ]
表单身份验证
Implement form authentication.
http://support.microsoft.com/kb/301240[^]
Form Authentication