Solved

How to auto refresh an ASP.NET page

Posted on 2010-11-14
2
898 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now