1,105,340 Community Members

How to find if the user has logged in for the first time - C#

Member Avatar
Newbie Poster
5 posts since Mar 2013
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

The scenario is, If the user has logged in for the first using his one time password it should get redirected to ResetPassword.aspx

If the user is not new, then should get redirected to Main.aspx page.

Should I use IsPostBack or Membership.ValidateUser?

How do we usually code in c# to check if its a new user (using first time login)

I am a newbie to programming not getting enough info on net. Please help

Member Avatar
Junior Poster in Training
72 posts since Aug 2010
Reputation Points: -3 [?]
Q&As Helped to Solve: 8 [?]
Skill Endorsements: 0 [?]

HI, You can use session.
You can add one more field in DB check to whether user is active user or not.

Member Avatar
Posting Virtuoso
1,676 posts since May 2010
Reputation Points: 793 [?]
Q&As Helped to Solve: 231 [?]
Skill Endorsements: 27 [?]

Generally you would include a field in the DB containing the last log on date, if this value is null, then it's a first time log on.

If you want to do things like forced password reset; the simplest way is to include a bit column that just states "ResetRequired" or something and set that to 1 in order to force the change.

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: