Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello i am using login form... i execute my program to disply this error how to avoid it.........
how to solve your login attempt was not successful please try again login
Posted
Comments
Nigam Patel 26-Dec-11 5:45am    
can you please make custom Error mode = off in web.config and post the error here.

First of all, you need to make sure you are using the right password.
Then ensure the connection to the database is working properly.
 
Share this answer
 
to make this easy first use static password and user id. read the value of textbox and check using condition :
C#
if(txtUserName.Text=="Abc" && txtPassword.Text=="Abc123")
{
Response.Write("welcome Login"); // code here
}
else
{
//....
}

if it is correct then check your database connection. Using debug check the query that you are passing to database and executing. and wrie code in try catch block and print the exception if there is, from this you can easily find where is the problem.
C#
try
{
//code here...

}
catch(Exception ex)
{
Response.Write(ex.Message);
}


Hope this will help you.
And don't forget to mark as answer if it helps. :)
 
Share this answer
 
C#
if(txtUserName.Text=="asd" && txtPassword.Text=="123")
{
Response.Write("Welcome.aspx"); 
}
else
{
your message
or make one label
lblError.text= "PLZ try Again";
}
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 26-Dec-11 7:54am    
Added pre tag

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