登录时,先用Session记录登录状态。
vb.net:
Session("LoginOK") = True
C#:
Session["LginOk"] = true;
然后在每个page_load中写:
If Not Session("LoginOk") Then
Response.Rediret("login.aspx")
End If
if (!Session["LoginOk"])
{
Response.Redirect("login.aspx");
}