I have a hyperlink on a header user control. When the user clicks the logout hyperlink it redirects to the main page with a parameter to logout. The main page "pageload" then logs out. There is an "if" statement on the user control to display the "Logout" hyperlink text. Please see code below. For some reason it seems that the header1.ascx runs first then the main.aspx runs. Any help will be greatly appreciated.
Main.aspx.page_load
If Not Request.Params("Logout") = "" Then
FormsAuthentication.SignOut()
End If
Header1.ascx.page_load
If HttpContext.Current.User.Identity.IsAuthenticated Then
lnkLogout.Visible = True
hyperRegisterProfile.Text = "My Profile"
Else
lnkLogout.Visible = False
hyperRegisterProfile.Text = "Register"
End If
Main.aspx.page_load
If Not Request.Params("Logout") = "" Then
FormsAuthentication.SignOut()
End If
Header1.ascx.page_load
If HttpContext.Current.User.Identity.IsAuthenticated Then
lnkLogout.Visible = True
hyperRegisterProfile.Text = "My Profile"
Else
lnkLogout.Visible = False
hyperRegisterProfile.Text = "Register"
End If