1,105,340 Community Members

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

Member Avatar
hookedtocsharp
Newbie Poster
5 posts since Mar 2013
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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
RvSon
Junior Poster in Training
72 posts since Aug 2010
Reputation Points: -3 [?]
Q&As Helped to Solve: 8 [?]
Skill Endorsements: 0 [?]
 
-1
 

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

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

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.

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