I have a LoginControl that works great, however, I want it to store more information than just being authenticated or not. I would like to store the UserID of the user so when they make changes I can call that UserID and record that they made the changes.
Here is my code.
Dim db As New DataClassesDataContext
Dim User = (From UserTable In db.Users _
Select UserTable _
Where UserTable.Active = True And _
UserTable.Name = LoginControl.UserName And _
UserTable.Password = RC.CryptedText _
)
If User.Count = 1 Then
e.Authenticated = True
Else
e.Authenticated = False
End If
I just want to be able to call the UserID later, I'm able to login and access the pages fine, but something like
Session("UserID") = LoginControl.UserName
Would be great as long as the session doesnt get cleared.