title: ASP.net AJAX Call doesn't work on 2nd click
body: <p>I have an ASP.net webforms application that has a client-side click event that makes an Ajax call (XMLHttpRequest) to a page that calls a long-running web service.</p>
  
  <p>The flow goes like this:</p>
  
  <blockquote>
    <p>Page1.aspx clicks on link that calls Page2.aspx</p>
    
    <p>Page2.aspx uses a delegate and IAsyncResult to make a call to WebService.asmx</p>
    
    <p>WebService.asmx uses an extended BackgroundWorker to to do work on separate thread</p>
  </blockquote>
  
  <p>The IAsyncResult calls BeginInvoke() and then EndInvoke()</p>
  
  <p><strong>The problem:</strong>  Clicking on the link on Page1.aspx works fine the first time - Page 1 calls Page 2, who calls the Webservice, and the work gets done.  </p>
  
  <p>If I click on the link again (after the WebService work is done), it doesn't fire off the work the Page2.aspx is supposed to call.</p>
  
  <p>When I debug through, I have a Javascript alert from Page1.aspx that says the XMLHttpRequest.send() request was called; however, the debugger doesn't bring me to the Page2.aspx page...in fact, it doesn't bring me anywhere.</p>
  
  <p>Below is the inside of my Ajax function:
      var xmlhttp = null;</p>
  
  <pre><code>if (window.XMLHttpRequest) {
       xmlhttp = new XMLHttpRequest();
  }
  else {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  xmlhttp.open("GET", "Page2.aspx?SomeQueryString=" + someID, true);
  xmlhttp.send();
  
  xmlhttp.onreadystatechange = function () {               
     if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) {
          try {
              var responseText = xmlhttp.responseText;
              document.getElementById("_lblExportStatus").innerHTML = responseText;
          }
          catch (e) {
               alert("Error: " + e.Message);
          }
     }
  }
  return false;
  </code></pre>
  
  <p><strong>Edit</strong>
  I've found that passing a different querystring to the XMLHttpRequest object does result in work being done.  The problem is with passing the exact same string in the Open() method.  Sending different strings to the open() method works fine.</p>