i have a question about asp.net Button ?

Tohoru san

New member
hello,

i have written these two codes :


Welcome , <% = Session("User")%>
<% If Session("User") = ("") Then

Button2.Text = "Log In"
Button2.PostBackUrl = "LogIn.aspx"
End If %>


here if my session was empty the Button text becoms "Log In"



the other code :

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Session.Abandon()
Button2.Text = "Log In"
End Sub



here i clear my session by clicking "Button2"
onclick my Button text will become "Log In"

it works fine
but

i have to click it twice !!

in first Click the Button Text changes

on the second click , it clears the session

wat should i do to make it only one click ??
 
Back
Top