asp.net - Make asp label invisible using timer -


i have show label indicating success of insertion of data. label should disappear automatically after 5 seconds how can achieve this??

 <html>  <head id="head1" runat="server">  <title>test visibility</title>  <script type="text/javascript">   $(document).ready(function () {     settimeout(function () {         $('#<%= lblerror.clientid%>').hide();     }, 100); // <-- time in milliseconds }); </script> </head> <body> <form id="form1" runat="server"> <div>  <asp:label id="lblerror" runat="server" text="label"></asp:label> </div>  </form> </body> </html> 

you can use jquery this.
call function , hide after particular duration.

settimeout(function() {    $('#labelid').hide(); }, 1000); // <-- time in milliseconds 

suppose have label

  <asp:label id="lblresult" runat="server" text=""></asp:label> 

so can use follows

  settimeout(function() {    $('#<%= lblresult.clientid%>').hide(); }, 1000); // <-- time in milliseconds 

and in document.ready call it.

$(document).ready(function() {        settimeout(function() {    $('#<%= lblresult.clientid%>').hide(); }, 1000); // <-- time in milliseconds }); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -