title: setInterval stops after Ajax request
body: <p>I'm using Asp.net MVC and I want my partial view to refresh on an interval, which it does until I make an unrelated Ajax request, then it stops.</p>
  
  <p>Here are a few simplified snips to illustrate the problem.</p>
  
  <p>in AjaxRefresh.js:</p>
  
  <pre><code>function ajaxRefresh()
  {
      var f = $("#AjaxForm");
      $("#AjaxLoading").show();
      $.post(f.attr("action"), f.serialize(), function (context) {
          $("#AjaxDiv").html(context);
          $("#AjaxLoading").hide();
      });
  }
  setInterval(ajaxRefresh, 1000);
  </code></pre>
  
  <p>in Index.aspx:</p>
  
  <pre><code>&lt;script type="text/javascript" src="../../Scripts/AjaxRefresh.js"&gt;&lt;/script&gt;
  &lt;div id="AjaxDiv"&gt;
      &lt;% Html.RenderPartial("Computers", Model, ViewData); %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and this in Computers.ascx:</p>
  
  <pre><code>&lt;% Ajax.BeginForm("Index", new { groupName = Model.Name }, new AjaxOptions() { HttpMethod = "Post", LoadingElementId = "AjaxLoading", UpdateTargetId = "AjaxDiv" }, new { id = "AjaxForm" }); Html.EndForm();%&gt;
  
  &lt;%= Ajax.ActionLink("Send", "Index", new { groupName = Model.Name, data="blah" },
          new AjaxOptions() { HttpMethod="Post", LoadingElementId="AjaxLoading", UpdateTargetId="AjaxDiv" }) %&gt; 
  </code></pre>
  
  <p>If you click the "Send" link, everything still works, but the page stops refreshing automatically. 
  I've tried subscribing to the ajax events, but Sys.WebForms.PageRequestManager.getInstance() is undefined.</p>