Msg#: 4340928 posted 4:11 am on Jul 24, 2011 (gmt 0)
In your original code, you always executed the line to create the count field and initialize it to 0. So it never even exceeded 1.
You could create it as "static" and it will retain it's value over postbacks. Additionally you could store the value in ViewState. It is much like your solution with Session except that if the user sits idle for 20 minutes the session will expire and your code would fail again.
Msg#: 4340928 posted 8:26 pm on Aug 12, 2011 (gmt 0)
I'm not sure why you are doing this , but if its to prevent the automated hacking of web forms it wont work, the software used sets the session cookies as required. You need to persist the data to a database or text file and add a time delay on each failed login.