title: Asp.net 5 mvc 6 get query string to view
body: <p>I have been googling for a few hours. But still not able to get the answer.  I need to get a query string parameter in a razor view.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>              if @(Request.Query["value"]=="P"){
  
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "A"})"&gt;&lt;strong&gt;Active (@ViewData["activeCount"]) &lt;/strong&gt;&lt;/a&gt; &amp;nbsp;
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "I" })"&gt;In-Active (@ViewData["inActiveCount"])&lt;/a&gt;&amp;nbsp;
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "D" })"&gt;Delete (@ViewData["deleteCount"])&lt;/a&gt;&amp;nbsp;
                 }else{
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "A"})"&gt;Active (@ViewData["activeCount"])&lt;/a&gt; &amp;nbsp;
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "I" })"&gt;&lt;strong&gt;In-Active (@ViewData["inActiveCount"])&lt;strong&gt;&lt;/a&gt;&amp;nbsp;
                      &lt;a href="@Url.Action("Index", "Staff",new { status = "D" })"&gt;Delete (@ViewData["deleteCount"])&lt;/a&gt;&amp;nbsp;
  
                 }
  </code></pre>
  
  <p>But i get the error "<strong>The name 'Request' does not exist in the current context</strong>"</p>
  
  <p>The screenshot
  <a href="https://i.stack.imgur.com/VwyOy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VwyOy.png" alt="enter image description here"></a>
  Anyone got solution? Thanks</p>