Click here to Skip to main content
15,069,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a code like below,

<meta http-equiv="refresh" content="1" >
<title>Runtime Status Report</title>

Hence it is always refreshing the page. Hence it's not good.
I need a button to enable and disable the auto referesh

You may use Timer control to auto refresh your page.
On button click disable the timer control if its enabled and vice versa.
In this way, you can enable/disable auto refresh of the page.
Here is a another way of what you want. Auto refreshing it, .

Place a button to enable this 'Auto refresh'. Put this code ther:
Response.AddHeader("Refresh", Convert.ToString("some time after which you need refresh");

Place another button to disable this. Remove this Header.
Response.AppendHeader("Refresh", Convert.ToString("some very large time will work like no refresh");

You are done!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900