| DAYS | HOURS | MIN | SEC |
In code behind:
protected void Timer1_Tick(object sender, EventArgs e)
{
DateTime dt = DateTime.Now;
TimeSpan differ;
System.DateTime date1 = new System.DateTime(2015, 4, 1, 20, 10, 0);
differ = date1.Subtract(dt);
double t = differ.TotalSeconds;
if (t > 0)
{
double dy, h, m, s;
dy = differ.Days;
h = differ.Hours;
m = differ.Minutes;
s = differ.Seconds;
Label13.Text = dy.ToString();// +" Days " + h + " Hours " + m + " Minutes " + s + " Seconds left for celebration";
Label14.Text = h.ToString();
Label15.Text = m.ToString();
Label16.Text = s.ToString();
}
else
{
Timer1.Enabled = false;
time_enable.Visible = false;
theDiv1.Visible = true;
}
}
My question is that i visible thDiv1 div from Time1_tick(). But thDiv1 is not visible. How i will do?
7 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Deepak VermaRank #672 · 3.6K reputationPosted Apr 20, 2015, 7:50 PM EDT
Currently, you've written it like this:
---------------
---------------
Change it to:
---------------
---------------
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Apr 19, 2015, 7:54 PM EDT
Try
Disable:
theDiv1.Attributes.Add("style", "display:none");
Enable:
theDiv1.Attributes.Add("style", "display:block");
Deepak VermaRank #672 · 3.6K reputationPosted Apr 19, 2015, 8:01 PM EDT
You should put 'theDiv1' inside the 'UpdatePanel1'.
Jishu das74 reputationPosted Apr 20, 2015, 6:52 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 20, 2015, 9:14 PM EDT
Jishu das74 reputationPosted Apr 21, 2015, 7:30 AM EDT
---------------
---------------
..............
...........
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Apr 21, 2015, 7:02 PM EDT
could you please say whats your requirement and expected result