Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Disable Label after some amount of time

0.00/5 (No votes)
16 Jan 2012 1  
Disable Label after some amount of time
Generally in some applications, we use labels to display error message. But even when some operations are done, the label text will be displayed what we initially show.I would like to show how we can disable label after some amount of time using Jquery.

XML
<script type="text/javascript" src="JScript.js"></script>

    <script type="text/javascript">
        $(document).ready(function() {
        $('#<%= Label1.ClientID %>').fadeOut(1500, function() {
                $(this).html(""); //reset the label after fadeout
            });
        });
    </script>


Drag and drop a label on to the form:

<asp:Label ID="Label1" runat="server" />


Download Jquery 1.7 that was required from here:

http://docs.jquery.com/Downloading_jQuery[^]

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here