Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi dear all,

i have user login page
UserName:
Password:

Now user entering username as Lupesosa but password wrong again he try log in with same username Lupesosa.password wrong again like this same username 'Lupesosa'
again wrong after he tries thrice then page must redirect to go another page like forgot password

How to do this

please help me

Thanks
Posted

1 solution

use viewstate and Custom validator:
C#
protected void Page_Load(object sender, EventArgs e)
        {
            if (ViewState["TryCount"] != null && (int)ViewState["TryCount"] ==3)
            {
                // Show Some Error Message
            }
        }

        protected void cvLogin_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (ViewState["TryCount"] != null)
            {
                int TryCount = (int)ViewState["TryCount"];
                ViewState["TryCount"] = ++TryCount;
            }
            else
            {
                ViewState["TryCount"] = 1;
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900