Posted on 2008-11-17
Last Modified: 2013-12-17
Hello Sir,

I have created login page in and if the user fails to login 3 times,then his account should be locked out.  I am having custom table and custom membership provider for valiating users in place. Can you please tell me how to implement this?.  

Question by:sickandarm
    LVL 14

    Expert Comment

    You might try storing the number of login attempts in the viewstate or session state.  Then everytime they attempt to log in and it failed the count would increase.  WHen it gets to your threshold lock them out in the database by setting a flag in the table.  

    You could also just create a failedLoginAttempts field in the table as well.   Every time they fail an attempt, increment the counter.  If they log in successfully, set the failedLoginAttempts back to 0.
    LVL 3

    Accepted Solution

    Storing the number of attempts in the viewstate or session won't be a good idea , a user can then exit the application and try again again without restriction.

    Storing the value in the table field is a nice idea.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now