Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Memory Leak with asp:timer and asp:updatepanel

$
0
0

The client side memory is increasing 1MB/30Min.

I don't understand why ?

 

Default.aspx

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

<! DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title></title>

</head>

<body>

<formid="form1"runat="server">

<div> 

<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">

        <ContentTemplate>

        Second (refresh all 5s):

<asp:LabelID="lSecond"EnableViewState="false"runat="server"Text="0"></asp:Label>

         </ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="Timer1"/>

 </Triggers>

     </asp:UpdatePanel>

<asp:TimerID="Timer1"runat="server"EnableViewState="false" Interval="5000"OnTick="Timer1_Tick"></asp:Timer>

</div></form>

</body>

</html>

 

Default.aspx.cs

public partialclass_Default : System.Web.UI.Page

{

  protectedvoid Page_Load(object sender, EventArgs e)

   {    

   }

  protectedvoid Timer1_Tick(object sender, EventArgs e)

   {

       if (Session["label1"] == null) Session["label1"] = "0";

        lSecond.Text = Session["label1"].ToString();

        int Time1 = Convert.ToInt16(lSecond.Text);

        Time1 += 5;

        lSecond.Text = Time1.ToString();

        Session["label1"] = lSecond.Text;

    }

}


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>