Whats going on?

W

Wardeaux

When you successfully login, you redirect the page to another page, this
happens at the server so the "altered" login page (the assignment ="") is
not downloaded to the browser but a new page is downloaded leaving the
previous page in cache. So when you hit the "Back" button, you recall the
page from your browser cache and get an exact copy of whatever was loaded
the last time it was sent from the server.
Hope this helps. :)
wardeaux
 
D

DaMan

I have a ASP.NET page with a text box that 'keeps the first value' I put in
it. On it reports if the logon is ok or not. heres the code snippet:

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
Dim t As Long
Try
tmpSQL.SQLDB.Open()
Dim strencrypt As String
strencrypt =
FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text,
"SHA1")
Dim strsql As String = "Select * from isusers where username='" &
txtLogin.Text & "' and password ='" & strencrypt & "'"
tmpSQL.SQLcmd.CommandText = strsql
Dim myreader As SqlDataReader = tmpSQL.SQLcmd.ExecuteReader
Dim blnAuthenticated As Boolean = False
If myreader.Read Then
lblError.Text = "" 'executes but does nothing
blnAuthenticated = True
Else
lblError.Text = "Invalid Login - Please Try Again"
blnAuthenticated = False
Exit Sub
End If
If blnAuthenticated Then
FormsAuthentication.RedirectFromLoginPage(txtLogin.Text, False)
Exit Sub
End If
Catch ex As Exception
lblError.Text = ex.Message
End Try
End Sub

The invalid login text displays if the login fails, but on sucessful it does
not clear the field, even though I stepped through the code and saw the = ""
execute. after successfull login, if I hit the back browser button the
Invalid text is still there, no matter how many times I login sucessfully..
Thnaks..
 
K

Kevin Yu [MSFT]

Hi DaMan,

We are currently researching on this issue and will update you ASAP.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
J

Jeffrey Tan[MSFT]

Hi DaMan,

Thank you for posting in the community!

Based on my understanding, you application use Form Authentication, when
you first login failed, the label control displays the error message. Then
you login succeed, and it redirects to another page. Then you click History
"Back" button, then the label still displays the error message.

=======================================================
I think Wardeaux's reply already explains the reason for this behavior, and
it is a strange behavior.(Because the web page did not render out)

If you feel it un-comfortable, please feedback to us your wanted behavior,
we will help you.

=======================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi DaMan,

Do you still have any concern on this issue?

If you still have concern, please feel free to tell me, I will help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi DaMan,

Thanks very much for your feedback.

I am glad you have found a workaround for your issue. If you have any
further concern, please feel free to tell me, I will help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top