I use timer to display current time in lable.But it does not working in Master Page.I added scriptmanager.I attached my Master page code here.
can anyone help me?
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="updatepage.Site1" %>
style="z-index: 1; left: 367px; top: 15px; position: absolute; height: 19px; font-weight: 700"
Text="MainPage">
In content page,the time in lable does not display.But i include
lbltime.Text = DateTime.Now.ToString(); on timer1_click()function..
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Sunny SharmaPosted May 25, 2013, 7:11 AM
Believe me... your code is working absolutely fine... the problem you see a delay there is, you haven't set the label's text property on form load. The Timer ticks in 10 seconds (Interval set by you), so it updates the label after 10 seconds the page is loaded, not meanwhile the page loads.
If you want the timer to show the time since the page loads, just copy and paste the time_tick() event code in Page_Load(), i.e:
Page_Load()
{
lbltime.Text = DateTime.Now.ToString();
}
Hope u got the point.
Please don't forget to accept this as answer if it helps!
Thanks.
Kavi sujaPosted May 25, 2013, 7:39 AM