请帮忙!使用Timer& UpdatePanel刷新数据会导致客户端浏览器内存泄漏 [英] Please Help! Refresh data using Timer&UpdatePanel cause client Browser Memory Leak

查看:143
本文介绍了请帮忙!使用Timer& UpdatePanel刷新数据会导致客户端浏览器内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP.NET的入门者:-O,

我正在基于ASP.NET WebForm在VS2010中编写一个网站,并遇到以下问题:doh::
在我的网站上,我需要刷新数据以实现实时监控.因此,我使用了asp.net ajax扩展服务器控件 Timer和UpdatePanel 来执行部分页面刷新.
该网站运行良好,只是它导致客户端浏览器(IE,Safari,Chrome,除了Firefox)出现内存泄漏问题
网站页面运行几个小时后,客户浏览器可能会占用大量内存.我在Internet上搜索,但还没有找到任何解决方案.
有人可以帮忙吗?:confused:
衷心感谢〜:rose:

我的简化代码如下:

I''m a begginner in ASP.NET :-O ,

I''m writing a website in VS2010 based on asp.net webForm, and bump into the problem below :doh: :
In my website, I need to refresh data to realize realtime monitoring. So I used asp.net ajax extension server controls Timer and UpdatePanel to perform partial page refreshment.
The website works well except it causes the client browser(IE,Safari,Chrome, except Firefox) having memory leak problem!
After the website page run several hours, the client browers can take up huge memories. I searched on Internet but haven''t figured out any solutions.
Can anyone help?:confused:
Thanks with all my heart~:rose:

My simplified codes are like this:

Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
</head>
<body>
  <form id="form1" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server" />
  <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
  <ContentTemplate>
  <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick" />
  <div>
  <asp:Label ID="Label1" runat="server" Text="你好,Hello" />
  </div>
  </ContentTemplate>
  </asp:UpdatePanel>
  </form>
</body>
</html>


Default.aspx.cs:


Default.aspx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  { }

  protected void Timer1_Tick(object sender, EventArgs e)
  {
  Label1.Text = "Refreshed value:" + DateTime.Now.ToString();
  }
}

推荐答案

好吧,看来您需要通知用户使用Firefox! :)

您似乎无法解决此问题,因为问题出在浏览器上.因此,您应该与对浏览器进行编程的团队接洽,并让他们知道存在问题.

http://connect.microsoft.com/ie [ http://dev.chromium.org/for-testers/bug-reporting-guidelines [ ^ ]

http://browsers.about.com/od/safar1/ss/safaribugreport_2.htm [ ^ ]

祝你好运!
Well, it looks like you need to inform users to use Firefox! :)

It looks like this isn''t something that you can fix because the problem is with the browser. So you should take it up with the team that programmed the browser and let them know there is a problem.

http://connect.microsoft.com/ie[^]

http://dev.chromium.org/for-testers/bug-reporting-guidelines[^]

http://browsers.about.com/od/safar1/ss/safaribugreport_2.htm[^]

Good luck!


这篇关于请帮忙!使用Timer&amp; UpdatePanel刷新数据会导致客户端浏览器内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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