Verfiy code after login

Posted on 2013-10-07
Medium Priority
Last Modified: 2013-10-15

I want to have verify code utility once a valid username/password has been entered.  So, after users login, a random code will be sent to their email address and then the users have to enter it again in the application to login.  Can I do that with asp.net C#?

Question by:perlwhite
  • 2
LVL 41

Expert Comment

ID: 39553743
What you are asking is doable and not that hard but need more information on where is it that you are facing trouble.
- Do you have login feature in place? If so are you using built-in asp.net control?
- Are you using asp.net membership providers?
- Do you want it on every single login or just when user registers very first time?

Author Comment

ID: 39554029
1. I have simple login feature in place.
2. I am not using membership providers!( I did not know they could be used, researching on them now)
3. I want to use this for every single login unless they are logging in after more than 30 days.

LVL 41

Accepted Solution

guru_sami earned 600 total points
ID: 39557369
- You will need to have a fields in your user table e.g. and Code(string)
- When user tries to login i.e. in Login button click, you can create a random string and store it in that "Code" field in the database. Email the user that string and redirect to some page called verifycode.aspx
- Once the user enters the valid code, can clear the Code field in the database, set FormsAuthenctication cookie and redirect user to your landing page.

You requirements are too broad to provide you full code.
Here's a sample though.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question