Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
3.00/5 (3 votes)
See more:
how to invisible label after 3second in c#?
Posted
Comments
joginder-banger 15-Feb-14 8:50am    
what's you want....

if its windows form
you can do it by 2 ways:-

1) use
Thread.Sleep(3000);
label.Visible=false;


2) use a timer
take a global variable of int datatype write in Tiker_Tick() function and set timer's interval "1000"
integervar++;
if(integervar == 3)
{
    label.visible=false;
    timer.Stop();
}
 
Share this answer
 
XML
<script type="text/javascript">
    window.onload = function () {
        var seconds = 3;
        setTimeout(function () {
           document.getElementById("<%=lblMessage.ClientID %>").style.display = "none";
        }, seconds * 1000);
    };
</script>


C#
<asp:label runat="server" id="lblMessage" Font-Bold="true"></asp:label>
 
Share this answer
 
v2
Comments
joginder-banger 15-Feb-14 8:49am    
I think he asking in c# not a asp .net..

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