Solved

How to auto refresh an ASP.NET page

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…

760 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

22 Experts available now in Live!

Get 1:1 Help Now