Click here to Skip to main content
15,899,126 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I want to create an ASP.Net page that fetch data from SQL 2005 database.As the values varies i want the web page to refresh itself after every few seconds so that those values get reflected in the web page.

Kindly suggest me a solution

thank you
Posted
Comments
senguptaamlan 21-Sep-10 6:01am    
do you want to refresh the whole page or a part of of the page???

<META HTTP-EQUIV="Refresh" CONTENT="10;URL=yourpage";>
in head tag of your page..

[How to refresh a page automatically in ASP.NET]
 
Share this answer
 
v2
You can refresh page automatically by using Standard META tag in head section.
In Content if you specify the URL (here http://www.yourURL.com), the page will be automatically redirect to the specified url after specific delay (here it is 10 seconds). If you do not specify the a URL, it will reload the same page after the interval.
<meta http-equiv="Refresh" content="10;URL=http://www.yourURL.com"></meta>


Also you can append the meta tag from code behind
Response.AppendHeader("Refresh", "10; URL=http://www.yourURL.com")
 
Share this answer
 
Comments
Member 14507998 29-Sep-20 6:08am    
Hi I need to refresh the data flowing to my asp.net pages into my sql tables every 1 second.
I can do this refresh using Timer.

<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:timer id="Timer1" runat="server" interval="1000">


But when I do this, the event happens on the WebBrowser side and it creates trouble for the server since 30 forms will be running at the same time.

How can I do this refresh in form, not in webbrowser?
Can you help on the subject.
Thank you.

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