2

I am using uCommerce with the cms member. For the forgot password password link validation i want the last password changed date for the required member but it gives wrong date as current date time value.

String userName = Membership.GetUserNameByEmail(email);
MembershipUser membershipUser = Membership.GetUser(userName);
if (membershipUser.LastPasswordChangedDate > date)
{

----- validation Where date is the datetime when user request forgot password request and link will sent to him

---- but all the time LastPasswordChangedDategetting current date time, so can not able to set the validation

}

Any Idea?

Thanks

Girish

Jonathan
  • 4,916
  • 2
  • 20
  • 37
Girish Chaudhari
  • 1,607
  • 5
  • 16
  • 24

1 Answers1

0

Just tried the following and it seems to be working for me. Could you try the following:

string userName = Membership.GetUserNameByEmail(email);
MembershipUser membershipUser = Membership.GetUser(userName);

if (membershipUser != null && membershipUser.LastPasswordChangedDate.Date > DateTime.Now.Date)
{
    // Do something
}
Jerode
  • 490
  • 4
  • 15