3 times login validation for login page

Posted by Subhadip under ASP.NET on 8/21/2012 | Points: 10 | Views : 1553 | Status : [Member] | Replies : 1
i want to how to write the code in asp dot net on button click. if user enter wrong user name and pasword for first time message will display "invalid user name" and if user enter wrong user name and password 3 times on current date message will display "sorry today you have tried 3 times login" this code not working properlly. want to kow how to write code in asp dot net itself on button click

Protected void btn_click()
{
int count=0;
cmd=new sqlcommand("select count(*) from emp_registration where username='"+ txtusername.text.trim()+"' and password='"+ txtpassword.text.trim()+"'",cn);
count=Convert.ToInt16(cmd.ExecuteScalar());
Sesssion["username"]=txtusername.text;
if(date.now()count==3)
{
lbl.test="sorry tou have tried 3 times login today"
count++;
If(count!=0)
{
Response.Redirect(aa.aspx);
}
}
else
{
Lbl.text="invalid user and password"
}
}




Responses

Posted by: Vasanthmvp on: 8/22/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can check through the solution here:

http://www.dotnetfunda.com/forums/thread11120-want-to-give-validation-for-3-times-login.aspx

Regards,

Awesome Coding !! :)

Subhadip, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response