title: Get full query string in C# ASP.NET
body: <p>As a PHP programmer I'm used to using $_GET to retrieve the HTTP query string... and if I need the whole string, theres loads of ways to do it. </p>
  
  <p>In ASP however, I can't seem to get the query.</p>
  
  <p>Here is the code for news.aspx (embedded in some HTML):</p>
  
  <pre><code>&lt;%                             
      string URL = "http://www.example.com/rendernews.php?"+Request.Querystring;
      System.Net.WebClient wc = new System.Net.WebClient();
      string data = wc.DownloadString(URL);
      Response.Output.Write(data);
  %&gt;
  </code></pre>
  
  <p>I am fetching a PHP script's output from a remote server, and this works perfectly without the Request.Querystring. </p>
  
  <p>The issue is that I'm trying to get the full query string on the first line: Request.Querystring. I am getting an error "<em>Object reference not set to an instance of an object</em>" which basically means that Request.Querystring doesn't exist.</p>
  
  <p>Any idea what the problem is here? How can I get that query string so when index.aspx is called like <a href="http://test.com/news.aspx?id=2" rel="noreferrer">http://test.com/news.aspx?id=2</a> my script fetches <a href="http://www.example.com/rendernews.php?id=2" rel="noreferrer">http://www.example.com/rendernews.php?id=2</a></p>