本文介绍了自动刷新有关更新数据库的网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完成数据库中的任何更新后如何刷新网站上的数据

how to refresh data on website when any updation in database is done

推荐答案


<meta http-equiv="refresh" content="120"></meta>



其中120是指刷新页面之前需要花费的秒数.
另外,如果您将URL放在标记内,也可以重定向到特定页面.



Where 120 refers to the number of seconds it will take before refreshing the page.
Also you can redirect to a specific page if you put the URL inside the tag.

<meta http-equiv="refresh" content="15;url=http://jinaldesai.net"></meta>



实际上,这是标准的HTML功能,而没有特定于ASP.NET的功能.无论是ASP.NET页面还是HTML页面,还是用Java,PHP,ColdFusion,Perl等制成的页面,都可以看到自动刷新的相同效果.
如果要动态设置刷新时间,则可以在ASP.NET中通过在Page_Load函数中添加服务器端代码来设置刷新时间来进​​行设置,如下所示:



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, as shown below:

Response.AppendHeader("Refresh"", "120")



在此处获得带有源代码的良好示例:
自动刷新网页


希望有帮助!



Get a good example with source code here:
Auto Refresh Web Page


Hope this help!


这篇关于自动刷新有关更新数据库的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 21:50
查看更多