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 175941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:47:18+00:00 2026-05-11T13:47:18+00:00

I know there should be an easy way to do this but I guess

  • 0

I know there should be an easy way to do this but I guess my brain isn’t working today. I need to refresh a page in x number of seconds. I can do that in .NET using the following:

Response.AddHeader('Refresh', '300'); 

This is fine except I also need to display the number of minutes and seconds until the next refresh.

So I am using the following code in javascript to do this from the client:

<script type='text/javascript''>       //enter refresh time in 'minutes:seconds' Minutes should range from 0 to inifinity. Seconds should range from 0 to 59     var limit='0:30'      if (document.images){         var parselimit=limit.split(':')         parselimit=parselimit[0]*60+parselimit[1]*1     }      function beginrefresh(){         if (!document.images)             return          if (parselimit==1)             window.location.reload()         else{              parselimit-=1             curmin=Math.floor(parselimit/60)             cursec=parselimit%60             if (curmin!=0)                 curtime=curmin+' minutes and '+cursec+' seconds left until page refresh!'             else                 curtime=cursec+' seconds left until page refresh!'              window.status=curtime             setTimeout('beginrefresh()',1000)         }     }      window.onload=beginrefresh;  </script> 

This works except for one thing – every time the page is refreshed, the browser (IE) gives the nag message about re-downloading content or something. This will not do. This is a page that users will have open all day and it needs to refresh without user intervention. I suppose I could do away with the message that displays the time till next refresh and just use the ASP.NET line, but if anyone has a better idea, I would really appreciate it.

  • 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. 2026-05-11T13:47:19+00:00Added an answer on May 11, 2026 at 1:47 pm

    Instead of using window.location.reload(), try doing a redirect to the current URL:

    window.location = window.location; 

    This way, the browser will not be doing a post back, but a new request to the server. You’ll want to test this in various browsers. I just tested FF 3 & IE8 quickly; both look good.

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

Sidebar

Related Questions

I know there's an easy way of doing this, but my recursion abilities are
I know there should be a simple fix for this, but im braindead at
I know there should not be multiple publishers publishing the same event. But how
There are many things that all programmers should know, but I am particularly interested
Good day, I would like to know if there is an easy way to
Yes, I know, one should not mix different platforms, but I am working on
I know there is a standard behind all C compiler implementations, so there should
As we know to generate a class file there should be atleast one class
Is there anything I should know before converting a large C++ program from VS2005
Are there any VC++ settings I should know about to generate better PDB files

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.