title: Cannot update an image using HttpHandler, UpdatePanel and a Timer
body: <p>I'm trying in ASP.NET to use a HTTPHandler to display an image and update every 5 sec.
  This httphandler simply renders the current time into a Bitmap.
  In aspx side, the Image is inside a AJAX UpadtePanel, and I'm using a timer to refresh the image every 5 sec.</p>
  
  <p>My problem is that :</p>
  
  <ul>
  <li>in IE9, the image is not updated at all. My HttpHandler is requested only once.</li>
  <li>in chrome, the image is updated but it "blinks", ie every 5s it is cleared for few secs then displayed, then cleared again etc...</li>
  </ul>
  
  <p>For debugging purpose I have also added inside the UpdatePanel a label, filled by a random value. It is well updated in both web browsers.</p>
  
  <p>Here is the code in my aspx page : </p>
  
  <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt;
  &lt;asp:Timer runat="server" ID="UpdateTimer" Interval="5000" OnTick="UpdateTimer_Tick" /&gt;
  &lt;asp:UpdatePanel runat="server" ID="TimedPanel" UpdateMode="Conditional"&gt;
      &lt;Triggers&gt;
          &lt;asp:AsyncPostBackTrigger ControlID="UpdateTimer" EventName="Tick" /&gt;
      &lt;/Triggers&gt;
      &lt;ContentTemplate&gt;
          &lt;asp:Image ID="TheImage" alt="httpHandler" src="getImage.ashx?id=1" runat="server" /&gt;
          &lt;asp:Label ID="Label" runat="server" Font-Size="XX-Large" &gt;&lt;/asp:Label&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>In my HttpHandler, I did not forget to disable caching like this :</p>
  
  <pre><code>cache.SetCacheability(HttpCacheability.NoCache);
  cache.SetNoStore();
  cache.SetExpires(DateTime.MinValue);
  </code></pre>
  
  <p>And to prevent my IE9 web browser caching the image, I also tried to change ImageUrl each time the timer is invoked in the aspx.cs file, like following. But my HttpHandler is still called only once when the page is displayed for the first time :</p>
  
  <pre><code>protected void UpdateTimer_Tick(object sender, EventArgs e)
  {
  Label.Text = ((System.Environment.TickCount / 100.0) % 360).ToString("F2");
  TheImage.ImageUrl = "getImage.ashx?id=" + System.Environment.TickCount.ToString();
  }
  </code></pre>
  
  <p>I hope my problem is well explained.
  What do I do wrong? </p>
  
  <p>Thanks in advance!</p>