-3

I have a C# asp.net application that I need to be refreshed a single page every 30 minutes automatically without run the project using c#(asp.net) .

aparna rai
  • 823
  • 10
  • 24
  • what do yu mean by without run the project? – ArunPratap Jan 08 '19 at 06:10
  • @ArunPratap i am working with hotel project and get some online booking details with ajax response and then that response insert into my sql table, now i want to know how to get response in every after 30 minuts without refresh the page – aparna rai Jan 08 '19 at 06:17
  • refreshing a page and running project is two thing update your question according to your need and tag Ajax your question is different from your need give more clear information so that anyone can help you – ArunPratap Jan 08 '19 at 06:27
  • Possible duplicate of [How to refresh page using c# int every five minutes?](https://stackoverflow.com/questions/12210056/how-to-refresh-page-using-c-sharp-int-every-five-minutes) – xdtTransform Jan 31 '19 at 08:05

2 Answers2

2

Use Mata Tags

<META HTTP-EQUIV="REFRESH" CONTENT="1800">

Other way is to use JavaScript:

setTimeout(function, milliseconds) Executes a function, after waiting a specified number of milliseconds.

setInterval(function, milliseconds) Same as setTimeout(), but repeats the execution of the function continuously.

setTimeout("location.reload(true);", timeout);

Edit: In reality, this is standard HTML functionality and nothing specific to ASP.NET. The same effect of auto-refresh would be seen whether it is an ASP.NET page or just a HTML page, or a page made in Java, PHP, ColdFusion, Perl or the like.

If you want to set the refresh time dynamically then that can be done in ASP.NET by adding server side code in the Page_Load function to set it like below:

Response.AppendHeader("Refresh", "1800")
Vishwa Ratna
  • 5,567
  • 5
  • 33
  • 55
1

You should try this one in head tag -

 <meta http-equiv="refresh" content="1800">