刷新我的.aspx网站,在C#中的计时器的最好方法? [英] The best way to refresh my .aspx site with a Timer in C#?

查看:452
本文介绍了刷新我的.aspx网站,在C#中的计时器的最好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要被刷新,每10秒一个Default.aspx页面。

I have a default.aspx page that needs to be refresh every 10 sec.

我的解决方法到目前为止是一个JavaScript函数,但它只是在Firefox和工作不是IE浏览器。

My solution so far is a javascript function, but it only works in Firefox and not IE.

我正在寻找一种方法来处理在default.aspx.cs页面刷新mecanism而是带有某种定时器。

I'm looking for a way to handle the refresh mecanism in the default.aspx.cs page instead, with some sort of Timer.

任何好的简单sugestions /提示或解决方案,在那里,可以使我在正确的方向?

Any good simple sugestions/hints or solutions out there that can lead me in the right direction?

推荐答案

有是附带在工具箱MS AJAX的计时器。添加一个ScriptManager,把你想要刷新内容的UpdatePanel内,然后添加AJAX的计时器。

There is a timer that is included with ms ajax in the toolbox. Add a ScriptManager, put the content you want refreshed inside an UpdatePanel and then add the ajax timer.

适当的跨浏览器脚本会那么对你产生。

The appropriate cross browser scripting will then be generated for you.

您可以在这里查看快速教程的如何使用ASPNET AJAX定时器控制

You can view a quick tutorial here How do I use the aspnet ajax timer control

有其它更复杂的技术,这可能更有效,但是这会给你几分钟的工作很好的效果。

There are other more complex techniques which may be more efficient, but this will give you good results for a few minutes work.

这篇关于刷新我的.aspx网站,在C#中的计时器的最好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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