隐藏消息后,显示消息 [英] Hide the label ,, After Displaying message

查看:74
本文介绍了隐藏消息后,显示消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

正在使用Asp.net C#,SqlServer2005.

我有一个登录页面.
如果用户输入了错误的用户名或密码...,则显示带有消息错误的用户名或密码的标签.
但问题是,我需要该消息几秒钟,它应该隐藏该消息.

请你能建议我怎么做.


谢谢.

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.

推荐答案

坏主意.如果您的用户在显示此消息时不使用显示器来to饮饮料,该怎么办? ?请执行以下操作:一直显示此消息,直到用户对用户名或密码编辑控件进行第一次更改.

处理此类事件的最佳实用方法是使用jQuery .change方法:
http://api.jquery.com/change/ [ http://en.wikipedia.org/wiki/JQuery [ http://jquery.com/ [ ^ ];
从这里开始:
http://docs.jquery.com/Tutorials:How_jQuery_Works [ http://docs.jquery.com/Tutorials [
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


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>";


Ranjith,
这是我的建议..您可以在用户再次输入用户名或密码时隐藏显示的消息...否则,您可以使用Thead.sleep(time)方法并在几秒钟后隐藏显示的消息....
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....


这篇关于隐藏消息后,显示消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆