Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Friends,

Am working on Asp.net C#, SqlServer 2005.

I have a login Page.
If the user Enters Username or Password Wrong...It is displaying a LABEL with Message Incorrect Username or Password..its working fine.

But the thing here is that., I need that message for few seconds and it should hide the message.

Please can u suggest me how to do this.


Thanks.
Posted

Bad idea. What if your user turn out of monitor to sip her/his drink during the time you show this message? Do the following: show this message all the time until the user make the first change in the user name or the password edit control.

The best practical way of handling such event is using jQuery .change method:
http://api.jquery.com/change/[^].

If you need to learn about jQuery (highly recommend it), please see:
http://en.wikipedia.org/wiki/JQuery[^],
http://jquery.com/[^];
start here:
http://docs.jquery.com/Tutorials:How_jQuery_Works[^],
http://docs.jquery.com/Tutorials[^].

—SA
 
Share this answer
 
C#
Label1.Text = "Password or Username incorrect"+
              "<script>var tmr;function st(){document.getElementById('" + Label1.ClientID + "').style.visibility='hidden';window.clearInterval(1);}tmr=window.setInterval('st()', 2000);</script>";
 
Share this answer
 
Hi Ranjith,
this is my suggestion..You can hide the displayed message when user is started to type the username or the password again...otherwise you can use Thead.sleep(time) method and hide the displayed message after few seconds....
 
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