Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET CSS SQL-Server
How to Blink a LABEL in for every 5 minutes.
Dear Friends,
I have a Label...This label is set as Date on my webform.
It must BLINK for every 5 should blink for just 10 seconds and go.
Please can u show me, how to do this.
Thanks in Advance.
Posted 18-Jun-12 20:44pm
Sergey Alexandrovich Kryukov at 19-Jun-12 3:10am
This is quite possible, but -- do yourself a favor, don't do it. What to irritate your users?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

try this
<body onload="changeColour('flashtext');">
<script type="text/javascript">
function changeColour(elementId) {
    var interval = 1000;
    var colour1 = "#ff0000"
    var colour2 = "#000000";
    if (document.getElementById) {
        var element = document.getElementById(elementId); = ( == colour1) ? colour2 : colour1;
        setTimeout("changeColour('" + elementId + "')", interval);
<p id="flashtext">This text will flash!!!</p>
Hope this will Help u
Best Luck
Ubaid ur Rahman IT at 19-Jun-12 3:06am
Boss !!
Listen to me, I need like this ??
Design Page
Label -> LabelId - lblmessage
Code behind page
lblMessage.Text = "Last Updated at : " + DateTime.Now.AddMinutes(-60).ToLongTimeString();

Just I need to blink the time for every 5 minutes....This label should blink only 10 seconds and go.

Thanks Please help me.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hi Ubaid,
Reference System.Threading, add an AJAX timer control and a ScriptManager to your aspx page.
<asp:ScriptManager ID="ScriptManager1" runat="server">
    <asp:timer runat="server" ID="tmr1" Interval="300000" ontick="tmr1_Tick"></asp:timer>
    <h1><asp:Label Text="" ID="lblTestTimer" runat="server"></asp:Label></h1>
in timer_tick event put the following codes:
protected void tmr1_Tick(object sender, EventArgs e)
            lblTestTimer.Text = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss tt");
            lblTestTimer.Visible = true;
            lblTestTimer.Visible = false;

This will do the trick what you want...Cheers !!
Happy Coding Smile | :)
Sunnykumar08 at 19-Jun-12 4:39am
Thanks for voting my answer. please don't forget to accept as answer if it helped you achieving the purpose.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 156
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505

Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 19 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100