[lnkForumImage]
TotalShareware - Download Free Software

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


 

DaMan

2/6/2004 4:14:00 PM

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..


5 Answers

v-kevy

2/7/2004 8:31:00 AM

0

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."

v-jetan

2/9/2004 8:45:00 AM

0


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.

v-jetan

2/11/2004 1:10:00 AM

0


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.

DaMan

2/11/2004 2:22:00 PM

0

I found a workaround, THnaks for help...



*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

v-jetan

2/12/2004 1:13:00 AM

0


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.