Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7051089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:13:20+00:00 2026-05-28T03:13:20+00:00

i have a master page which uses script manager and on another page i

  • 0

i have a master page which uses script manager and on another page i want to show a digital clock which counts from 0 to 10 minutes.
asp.net code:

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick">
    </asp:Timer>    
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
 <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

C# code:

int min=0,sec=0;
 protected void Timer1_Tick(object sender, EventArgs e)
 { 
    if (sec == 55)
    {
        min = min + 1;
        sec = 0;
    }
    else
    {
        sec = sec + 5;
    }
    Label1.Text = min.ToString() +":"+ sec.ToString();
    if(min==10&&sec==0)
    {
        Timer1.Enabled=false;
        Label1.Text = "clock over!";
    }

the page starts with 0:5 and doesn’t change at all. pls point out if there is an error in d code!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:13:21+00:00Added an answer on May 28, 2026 at 3:13 am

    My bet is that it will be your update panel. For debug purposes

    1. Try without the upadte panel at all – does it work then
    2. Put the timer in the update panel and forget about the trigger

    In fact point 2 could be done anyway – I’m not sure of the benefit of having it as a postback trigger. It would do just as well with the timer inside

    However

    Honestly I wouldn’t do this. Won’t the Tick method perform a postback (albeit partial) just to get the timer display going.

    There are lots of freely available components that will run purely on the client side which will be a lot (lot) more efficient e.g.

    JQuery Timer

    EDIT

    Actually I think I’ve spotted the problem. It is how you record mins and secs. These are in variables and would be reset every postback (Timer tick). Youu would need to store them into something that would perist postback e.g. ViewState

    protected void Timer1_Tick(object sender, EventArgs e)  {  
    
       ViewState["min"] //not int min
       ViewState["sec"] //not int sec
    
       //.. you would need to use Convert (or Int32.Parse) to get 
       //.. then as an int to work with
    
    }
    

    But homestly – still don’t do it. Use the JQuery component or similar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net web page, which uses a Master Page template. The page
I have a master page which all my views inherit from. The issue I
In my .aspx page which derives from a master page I have a contact
I have an ASP.net page which uses a master page. The master page has
I have a MainPage.Master and another ContentPage.Master which uses MainPage.master as its masterpage (
I have one master page which applies to all pages in this website. On
I have a Master Page which has an associated css file. On one of
I have a master page which references a style in the following manner: <link
I have 2 references to jQuery in my master page which is currently configured
I have a master page in my asp.net MVC project, which has code like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.