用于刷新页面 [英] For refreshing a page

查看:106
本文介绍了用于刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个aspx页面......我的目标是当我将一些新文件添加到文件夹中时,计数应显示在网页中并在新的时候保持刷新文件被添加到文件夹....我使用了ajax和jquery并获得了结果,但我需要知道除了ajax jquery和javascript之外还有其他方法吗?

Hi,
I have an aspx page...My aim is that when I add some new file into a folder then the count should be shown in the webpage and keeps on refreshing whenever a new file is added to the folder....I used ajax and jquery and got the result but I need to know if there are other methods other than ajax jquery and javascript?

推荐答案

<script type="text/JavaScript">
function timedRefresh(timeoutPeriod)
{
setTimeout("location.reload(true);", timeoutPeriod);
}

</script>





此脚本设置在文件上传按钮onclick事件



this script set on your file upload button onclick event


我最近在SignalR上玩得很开心。



http ://signalr.net/ [ ^ ]



您可以执行服务器发送的事件!



每个会话保持一个连接打开,无论您有多少服务器集线器除非你期望成千上万的访问者与SignalR相连,否则创建非常好
I've been having a lot of fun with SignalR lately.

http://signalr.net/[^]

You can perform server sent events!

It hold one connection open per session, no matter how many server "hubs" you create so it's very good unless you expect thousands of visitors to be connected with SignalR


有很多方法可以在asp.net中引用页面...



Java脚本

There are various method to referesh the page in asp.net like...

Java Script
<script type="text/javascript">
  function reloadPage()
  {
    window.location.reload()
  }
</script></script>



背后的代码


Code Behind

Response.Redirect(Request.RawUrl)



元标记


Meta Tag

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



页面重定向


Page Redirection

Response.Redirect("~/default.aspx"); // Or whatever your page url


这篇关于用于刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆