title: Communication between js client and asp.net server
body: <p>I write web site in VS 2008. I use extjs for make side with gridView and button. Now I want to send request to server. I add event to click on button:</p>
  
  <pre><code>    function getData()
      {
          var xmlhttp;
          if (window.XMLHttpRequest)
          {
              xmlhttp = new XMLHttpRequest();
          } else
          {
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
  
          xmlhttp.open("GET", "Default.aspx", true);
          xmlhttp.setRequestHeader("data", "true");
          xmlhttp.send();
      }
  </code></pre>
  
  <p>And my question is how can I receive this request on server? I found in the Internet that I should to do it like this:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (Request.Headers["data"] != null)
      {
          // do something
      }
  }
  </code></pre>
  
  <p>but it doesn't work. I don't understand it, if I use JS page doesn't reload, so why I must check it in method page_load?</p>