title: How to Timeout a request using Html Agility Pack
body: <p>I'm making a request to a remote web server that is currently offline (on purpose).</p>
  
  <p>I'd like to figure out the best way to time out the request.  Basically if the request runs longer than "X" milliseconds, then exit the request and return a <code>null</code> response.</p>
  
  <p>Currently the web request just sits there waiting for a response.....</p>
  
  <p>How would I best approach this problem?</p>
  
  <p>Here's a current code snippet</p>
  
  <pre><code>    public JsonpResult About(string HomePageUrl)
      {
          Models.Pocos.About about = null;
          if (HomePageUrl.RemoteFileExists())
          {
              // Using the Html Agility Pack, we want to extract only the
              // appropriate data from the remote page.
              HtmlWeb hw = new HtmlWeb();
              HtmlDocument doc = hw.Load(HomePageUrl);
              HtmlNode node = doc.DocumentNode.SelectSingleNode("//div[@class='wrapper1-border']");
  
              if (node != null)
              { 
                  about = new Models.Pocos.About { html = node.InnerHtml };
              }
                  //todo: look into whether this else statement is necessary
              else 
              {
                  about = null;
              }
          }
  
          return this.Jsonp(about);
      }
  </code></pre>