Lock the account, if user puts wrong password 3 times

Arunprasad T S V 1 Reputation point
2022-10-27T12:21:31.403+00:00

I am using viewstate to store the count of the login attempts. If wrong password means , I increase the count. If this count > 3 , then i lock the account. But my problem is:
I have 2 users : James and John. James puts 2 times wrong password. The viewstate count sets 2. After that in the same screen John tries to login. He gave wrong password. So John account will be locked at the first attempt. Because the viewstate count be 3. How can i handle this situation? Kindly give solution.

Thank you.
Regards,
Arunprasad

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
1,488 questions
{count} votes