I have 2 buttons in the login.aspx. The first button is submit button which is check the if username and password are matched with the database and another vote button is to redirect to a vote.aspx.
By right, after I click the submit button, it wont redirect to any page but is to authenticate the username and password. After login sucessfully, I want to display something like "Welcome, user" in the same login.aspx. The page will redirect to vote.aspx until vote button is clicked. and the vote.aspx should check if the user is loged in. If the user is not log in then will redirect back the login.aspx.
My problems is after log in sucessfully, I try to click the vote.button, but it wont redirect to the vote.aspx page.
login.aspx
if submit button clicked
dim status as integer = 0 **this is global variable in log in page**
If ( ValidateUser(txtUserName.Text, txtPassword.Text) ) Then
lblDisplay.Text = "Welcome, " & User.Identity.Name
status = 1
End if
if vote button clicked
If status = 1 then
FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, true)
status = 0
End if
vote.aspx
If User.Identity.IsAuthenticated Then
label1.Text = "Current User : <b>" & User.Identity.Name & "</b>" & _
"<br><br>Authentication Used : <b>" & User.Identity.AuthenticationType & "</b>"
'delete the users auth cookie and sign out
else
Response.Redirect("login.aspx")
End If
Hope those experts can help me out... Thanks.