C#
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
MembershipUser mu = Membership.GetUser(Login1.UserName);
DateTime dt = mu.LastLoginDate;
Session["lastlogindt"] = dt;
// Then authenticate the user here (e.Authenticate = true)
}
VB.NET
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs)
Dim mu As MembershipUser = Membership.GetUser(Login1.UserName)
Dim dt As DateTime = mu.LastLoginDate
Session("lastlogindt") = dt
' Then authenticate the user here
End Sub
Works great!!
ReplyDelete