Hi All, I have an ASP.NET 4.0 C# site. I am tracking failed log in attempts. After 3 I lock account. I am using a database to keep track of invalid login attempts. I got it to work if user enters 3 bad attempts in a row. My problem is if they only have 2 failed attempts, I need to delete info in database before next user tries to log in, if I don't and they have just 1 failed attempt they will be locked out. I tried using if !IsPostBack on Page load, but apparently clicking on a link that brings user back to log in page is NOT a postback. Any ideas or suggestions would be greatly appreciated.
In your code, where user gets successful login, add code which resets the count back for the user. and every time a user successfully logins, its count must be reset, no matter how many times he failed to login.
Edited 17-Oct-12 6:47am
Very simple, when a user successfully logs in, just add the logic to that process which sets that field back to 0.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)