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

Recommended Answers

All 2 Replies

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.