如何在显示消息后自动隐藏标签 [英] how to automatic hide label after display an messge

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

问题描述

你好朋友



i想要在几分钟后自动隐藏标签信息。

这里是我的代码,但它无法正常工作。 aspx页面中的


 <   script     type   =  text / javascript    language   =  javascript >  
$( #lblmsg)延迟(5000).fadeOut(100);
< / script >
< asp:Label ID = lblmsg runat = server 可见 = false >





或.cs页面



  protected   void  btnSubmit_Click( object  sender,EventArgs e)
{
if (cityList.Count!= 0
{
lblmsg.Visible = true ;
lblmsg.Text = YES!COD付款选项可用于此Pincode;
lblmsg.Attributes.Add( style 颜色:绿色;);
}
}



但是没有隐藏标签..

请帮帮我或者给其他一些方法这样做..

谢谢大家...

解决方案

(#lblmsg)。delay(5000).fadeOut( 100);
< / script >
< asp:Label ID = lblmsg runat = server 可见 = false >





或.cs页面



  protected   void  btnSubmit_Click( object  sender,EventArgs e)
{
if (cityList.Count!= 0
{
lblmsg.Visible = true ;
lblmsg.Text = YES!COD付款选项可用于此Pincode;
lblmsg.Attributes.Add( style 颜色:绿色;);
}
}



但是没有隐藏标签..

请帮帮我或者给其他一些方法这样做..

谢谢大家......


阅读本文



ASP.NET在几秒钟后隐藏控件 [ ^ ]





希望这会有所帮助,如果是,那么请接受并投票给答案。如有任何疑问/问题,欢迎随时提出。



谢谢&问候

RDBurmon.Sr.Software工程师


Javascript中的服务器端ID和ID不一样。构建JavaScript代码段时需要使用ClientID:



< script type =text / javascriptlanguage =javascript> ; 

hello friends

i want to hide label message after few minute automatically.
here is my code but its cant work.
in aspx page

<script type="text/javascript" language="javascript">
            $("#lblmsg").delay(5000).fadeOut(100);
        </script>
<asp:Label ID="lblmsg" runat="server" Visible="false">   



or in .cs page

protected void btnSubmit_Click(object sender, EventArgs e)
{
          if (cityList.Count != 0)
          {
              lblmsg.Visible = true;
              lblmsg.Text = "YES! COD payment option is available for this Pincode";
              lblmsg.Attributes.Add("style", "color:Green;");
          }
}


but is not hide the label..
please help me or give some other method to do this..
Thank You to all...

解决方案

("#lblmsg").delay(5000).fadeOut(100); </script> <asp:Label ID="lblmsg" runat="server" Visible="false">



or in .cs page

protected void btnSubmit_Click(object sender, EventArgs e)
{
          if (cityList.Count != 0)
          {
              lblmsg.Visible = true;
              lblmsg.Text = "YES! COD payment option is available for this Pincode";
              lblmsg.Attributes.Add("style", "color:Green;");
          }
}


but is not hide the label..
please help me or give some other method to do this..
Thank You to all...


Read this

ASP.NET Hide Controls after number of seconds[^]


Hope this helps , If yes then plz accept and vote the answer. Any queries / questions on this are always welcome.

Thanks & Regards
RDBurmon.Sr.Software Engineer


Server-side IDs and IDs in the Javascript are not the same. You need to use the ClientID when constructing that JavaScript snippet:

<script type="text/javascript" language="javascript">


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

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