Hi,
Login control authenticates only one user... Whats wrong?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Dec 25, 2010, 5:52 AM
Sam HobbsPosted Dec 25, 2010, 3:56 AM
I probably cannot help but I think it will help those that can help you if you also answer the following question.
What is happening that is not supposed to happen or what is not happening that is supposed to happen?
Ananya SuhasPosted Dec 25, 2010, 3:06 AM
If uservalidate(Login1.UserName, Login1.Password) Then
e.Authenticated = True
Login1.Visible = False
Session("user_id") = Login1.UserName
Response.Redirect("home.aspx")
Else
e.Authenticated = False
'MsgBox("Invalid username/password", MsgBoxStyle.Information, "Mohire`s")
End If
End Sub
Private Function uservalidate(ByVal username As String, ByVal password As String) As Boolean
Dim boolreturn As Boolean = False
obj.Connect()
obj.cmd.CommandText = "select username,password from user_login"
obj.dtr = obj.cmd.ExecuteReader
While (obj.dtr.Read)
If (username = obj.dtr("username")) And password = (obj.dtr("password")) Then
boolreturn = True
End If
obj.dtr.Close()
Return boolreturn
End While
Return boolreturn
End Function
THIS IS THE CODE I AM USING FOR AUTHENTICATION
Mahesh ChandPosted Dec 24, 2010, 11:30 PM
Sam HobbsPosted Dec 24, 2010, 10:40 PM