title: Aspx Async call - Full domain server name
body: <p>I have an ASPX page which calls a Web Service asynchronously: </p>
  
  <pre><code>   public async Task GetTypeAccess()
     {
          HttpResponseMessage response = await new Common.HttpClient().GetAsync("http://webserviceURL:port/Accounts/CurrentUser");
          string responseContent = await response.Content.ReadAsStringAsync();
  
          if (response.IsSuccessStatusCode)
          {
              ..                
          }
          else
          {
             Response.Redirect("~/AccessDenied.html");
          }
      }
  </code></pre>
  
  <p>In the Page Load this method is registered as Asynchronous</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
   {
       if(!IsPostBack)
       {
             RegisterAsyncTask(new PageAsyncTask(GetTypeAccess));
       }
  }
  </code></pre>
  
  <p>The ASPX page is declared async </p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind=...  Async="true" %&gt;
  </code></pre>
  
  <p>Now, if the page is called using the IP address, or the Host Name, the web service call is fired, response is waited and user is authenticated:</p>
  
  <pre><code>http://IP_address:60815/Home/MainPage.aspx
  http://hostname:60815/Home/MainPage.aspx
  </code></pre>
  
  <p>If, i call the page using the full domain name  (and updating the  with its full domain name) the web service call isn't fired, and opens the AccessDenied page. </p>
  
  <pre><code>http://hostname.subdomain.com:60815/Home/MainPage.aspx
  </code></pre>
  
  <p>Seems that the method, supposed to be asynchronous, is not actually "await"-ing for the call in this second case.</p>
  
  <p>I actually cannot find the relation between the two things, but by simply changing both URLs (page and webserviceURL) including the full domain name, the behavior is different.</p>
  
  <p>Using Windows authentication</p>