S
shapper
Hello,
I have a link button which signs out the user when it is clicked.
I place on by button the code line ibLogout.Visible =
My.User.IsAuthenticated.
So, when the user is authenticated the button logout is visible.
Otherwise is invisible.
There is a problem:
When I click logout the button does not get invisible. I need to
click it again or refresh the page so it takes effect.
Could someone, please help me out with this?
I believe this has something to do with the load, init, etc events.
Here is my code:
1 Private Sub lbLogout_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles lbLogout.Load
2 With lbLogout
3 .ID = "lbLogout"
4 .Text = "logout"
5 .Visible = My.User.IsAuthenticated
6 End With
7 End Sub
8 Private Sub lbLogout_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles lbLogout.Click
9 FormsAuthentication.SignOut()
10 End Sub ' lbLogout_Click
Thank You,
Miguel
I have a link button which signs out the user when it is clicked.
I place on by button the code line ibLogout.Visible =
My.User.IsAuthenticated.
So, when the user is authenticated the button logout is visible.
Otherwise is invisible.
There is a problem:
When I click logout the button does not get invisible. I need to
click it again or refresh the page so it takes effect.
Could someone, please help me out with this?
I believe this has something to do with the load, init, etc events.
Here is my code:
1 Private Sub lbLogout_Load(ByVal sender As Object, ByVal e As
EventArgs) Handles lbLogout.Load
2 With lbLogout
3 .ID = "lbLogout"
4 .Text = "logout"
5 .Visible = My.User.IsAuthenticated
6 End With
7 End Sub
8 Private Sub lbLogout_Click(ByVal sender As Object, ByVal e As
EventArgs) Handles lbLogout.Click
9 FormsAuthentication.SignOut()
10 End Sub ' lbLogout_Click
Thank You,
Miguel