[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Wardeaux

2/6/2004 3:52:00 PM

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

"DaMan" <mail@kyndall.com> wrote in message
news:%23$lXqPM7DHA.2044@TK2MSFTNGP10.phx.gbl...
> 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..
>
>