简体   繁体   中英

Refresh gridview after remote update

I have a gridview on an ASP page displayed on www.myurl.com/page1. It displays data that can be modified by other computers using a different page (www.myurl.com/page2) on the same website. I'd like to make it such that when user 1 adds data, the gridview on user 2's page refreshes with the new data (but it's not the same exact data).

Is there a way that the gridview can be notified of a data update? Or do I just resort to 10 second refreshes (which I'd like to avoid)?

You can use the Ajax UpdatePanel in your application which works like this: https://msdn.microsoft.com/en-us/library/bb399001.aspx

Use an Ajax timer control along with the gridview in the UpdatePanel to refresh the grid for every 5/10 seconds. In this way, only the gridview part of it gets refreshed and not the entire page.

http://www.devcurry.com/2009/03/how-to-refresh-aspnet-gridview.html .

Possible duplicate question : asp.net refresh web page on DB changes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM