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

  • Home
  • SEARCH
  • 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 8988593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:02:20+00:00 2026-06-15T22:02:20+00:00

Default.aspx <asp:ScriptManager ID=ScriptManager1 runat=server> </asp:ScriptManager> <asp:UpdatePanel ID=UpdatePanel1 runat=server> <ContentTemplate> <asp:Label ID=Label1 runat=server>2:00:00</asp:Label> <asp:Timer ID=Timer1

  • 0

Default.aspx

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Label ID="Label1" runat="server">2:00:00</asp:Label>
        <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
        </asp:Timer>
    </ContentTemplate>
</asp:UpdatePanel>

Default.aspx.vb

Dim timer, timer_arr() As String
timer = Label1.Text
timer_arr = timer.Split(":")
Dim seconds = Integer.Parse(timer_arr(2))
Dim minutes = Integer.Parse(timer_arr(1))
Dim hours = Integer.Parse(timer_arr(0))
If seconds = 0 And minutes = 0 And hours = 0 Then
    Timer1.Enabled = False
Else
    seconds = seconds - 1
End If
If (seconds < 0) Then
    seconds = 59
    minutes = minutes - 1
End If
If minutes < 0 Then
    minutes = 59
    hours = hours - 1
End If

Label1.Text = hours & ":" & minutes & ":" & seconds

The above code showing the expected result, i mean, i need the count down timer, which will display the countdown timer to the client like 2:45:34. But the problem is the value of seconds is decreasing by twice. i mean after 2:45:34 in the next second instead of displaying 2:45:33, it displaying 2:45:32 and so on. I’m very confused, from my point of view, everything is all right. Need help !!

UPDATED

I believe, client side scripting i.e. javascript will be the another option, but i need the timer for online exam system, which means timer should continue ticking whenever client send the request to the server. But, if i will use javascript then timer value will interrupted and will show unexpected value i.e. may be initialized again, and other cause. So, i believe server side scripting will be the best. If anyone have other suggestion, then i will appreciate. !!

  • 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-06-15T22:02:20+00:00Added an answer on June 15, 2026 at 10:02 pm

    I know, its too late to share answer of this question, Since, i found this solution and i felt, other can get the benefit of my solution.

    this is what i done…

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:Label ID="questionText" runat="server"></asp:Label>
    <asp:HiddenField ID="txt_timer" Value="00:30:00" runat="server" />
    <asp:Timer ID="Timer1" runat="server" Interval="1830" OnTick="Timer1_Tick"></asp:Timer>
    </ContentTemplate>
    </asp:UpdatePanel>
    

    I have used hiddenfield, which keep update the timer and now, i’m using <div> on which i’m displaying the counter

    <div id="counter" style="position: absolute; top: 165px; left: 850px;"></div> 
    

    now i added my javascript and css code to my file for better look of count-down timer

    timer.js

    <script src="../ajax/jquery.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../js/jquery.countdown.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
          $(function(){
            $('#counter').countdown({
              image: '../images/digits.png',
              startTime: document.getElementById('<%= txt_timer.ClientID %>').value,
            //  timerEnd: function(){ //alert('end!'); },        
               });           
          });
        </script>
    

    timer.CSS

    <style type="text/css">
        .cntSeparator
        {
            font-size: 55px;
            margin: 5px 2px;
            color: #000;
        }
    </style>
    

    You can see demo of countdown timer here

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

Sidebar

Related Questions

I want to display time in a label. My code is: <asp:ScriptManager ID=ScriptManager1 runat=server
I have a standard asp:login control: <asp:Login ID=mbLogin runat=server TitleText= DestinationPageUrl=~/Default.aspx PasswordRecoveryText=Forgot your password?
How to access to Label5 from behind page file(default.aspx.cs)? <ItemTemplate> <asp:Image ID=Image1 runat=server />
what I am writing on aspx page is <asp:HyperLink ID=HyperLink1 runat=server NavigateUrl=~/Comp/Default.aspx?abc=71&xyz=<%# DataBinder.Eval(Container.DataItem,TeamId) %>
Here's a my Default.aspx page (with unnecessary details excised): <asp:Content ID=Content1 ContentPlaceHolderID=ContentPlaceHolder1 Runat=Server> <div
Below is the content of my Default.aspx <asp:Content ID=BodyContent runat=server ContentPlaceHolderID=MainContent> <h2> WELCOME </h2>
I have an UpdatePanel in my default.aspx page and the UpdatePanel has asp placeholder,
I've a ASP.Net page (Default.aspx) which will load UserControl (ucontrol.ascx) dynamically into an UpdatePanel.
I've inherited an ASP.NET project that uses a single Default.aspx file in the public_html
In an ASP.Net WAP, the home page /default.aspx is receiving periodic requests from I-know-not-where.

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.