Hi,
Login control authenticates only one user... Whats wrong?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sam HobbsRank #108 · 20.5K reputationPosted Dec 24, 2010, 5:40 PM EST
Mahesh ChandRank #1 · 393.4K reputationPosted Dec 24, 2010, 6:30 PM EST
Ananya Suhas65 reputationPosted Dec 24, 2010, 10:06 PM EST
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
Sam HobbsRank #108 · 20.5K reputationPosted Dec 24, 2010, 10:56 PM EST
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?
Suthish NairRank #92 · 22.8K reputationPosted Dec 25, 2010, 12:52 AM EST