title: C# Passing GET parameter in the webclient
body: <p>I am trying to capture the return html after a button click. I've used fiddler to see what request gets sent when the user clicks a button. Below is the header information.   </p>
  
  <pre><code>GET http://www.nseindia.com/products/dynaContent/equities/equities/bulkdeals.jsp?symbol=&amp;segmentLink=13&amp;symbolCount=&amp;dateRange=day&amp;fromDate=&amp;toDate=&amp;dataType=DEALS HTTP/1.1
      Host: www.nseindia.com
      Proxy-Connection: keep-alive
      Accept: */*
      X-Requested-With: XMLHttpRequest
      User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36
      Referer: http://www.nseindia.com/products/content/equities/equities/bulk.htm
      Accept-Encoding: gzip, deflate, sdch
      Accept-Language: en-US,en;q=0.8
  </code></pre>
  
  <p>I have the below code which is not working. Can someone please point me to the correct solution ?</p>
  
  <pre><code>  var nseBulkDealsUrl = @"http://www.nseindia.com/products/dynaContent/equities/equities/bulkdeals.jsp?symbol=&amp;segmentLink=13&amp;symbolCount=&amp;dateRange=day&amp;fromDate=&amp;toDate=&amp;dataType=DEALS";
  
      var client = new WebClient();
      client.Encoding = Encoding.UTF8;
  
      var values = new NameValueCollection();
      values.Add("Referer", "http://www.nseindia.com/products/content/equities/equities/bulk.htm");
      values.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36");
      values.Add("X-Requested-With", "XMLHttpRequest");
  
      client.Headers.Add(values);
      client.Proxy = WebRequest.DefaultWebProxy; 
  
      var htmlPageSource = client.DownloadString(nseBulkDealsUrl);
  </code></pre>