Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to auto refresh an ASP.NET page

Posted on 2010-11-14
2
Medium Priority
?
930 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 2000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

926 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