Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to auto refresh an ASP.NET page

Posted on 2010-11-14
2
903 Views
Last Modified: 2012-05-10
I need to refresh an Asp.net page automatically based on the refresh interval.
Please note that I am using master page in my project.

How can I do that. I tried one optiom of adding this in my master page but that refreshes content in all the pages that use the master page
<meta id="RefreshPeriod" runat="server" http-equiv="refresh" content="60" />
0
Comment
Question by:countrymeister
2 Comments
 
LVL 1

Accepted Solution

by:
Griffin74 earned 500 total points
ID: 34132064
You can do this by adding a javascript function into the page you wish to reload, like this:

    <script type="text/javascript" language="javascript">
        function ReloadPage()
        {
                location.reload();
        }

    </script>

Drop a timer control onto your page, set its interval to the refresh interval you require. On the OnTick event of the timer call the ReloadPage() function.  When the timer hits the interval you have specified, the ReloadPage function will fire and your page will reload.

Hope this helps.
0
 
LVL 1

Author Closing Comment

by:countrymeister
ID: 34132261
thanks , that was great
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question