title: "The name 'Request' does not exist in the current context"
body: <p>EDIT: I have now changed <code>Request</code> to <code>Context.Request</code> and am receiving a different error to the title of this post now: <code>Cannot apply indexing with [] to an expression of type 'HttpRequest'</code></p>
  
  <p>So I am trying to introduce myself to ASP.Net and am following an online tutorial available here: <a href="https://www.w3schools.com/asp/webpages_forms.asp" rel="nofollow noreferrer">https://www.w3schools.com/asp/webpages_forms.asp</a> (the 'Displaying Images' part).  I am attempting to implement this in an MVC style layout.  The starting template for the structure is a modified version of the template that is produced when you run <code>dotnet new -t web</code>.</p>
  
  <p>In my Pictures.cshtml file, I have the following:</p>
  
  <pre><code>@{
      ViewData["Title"] = "Pictures";
  
      var imagePath="";
      if (Request["Choice"] != null) 
      {
         imagePath="images/" + Request["Choice"];
      }
  }
  
  &lt;h2&gt;Pictures&lt;/h2&gt;
  
  &lt;form method="post" action=""&gt;
      I want to see:
      &lt;select name="Choice"&gt;
      &lt;option value="Photo1.jpg"&gt;Photo 1&lt;/option&gt;
      &lt;option value="Photo2.jpg"&gt;Photo 2&lt;/option&gt;
      &lt;option value="Photo3.jpg"&gt;Photo 3&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="submit" value="Submit" /&gt;
      @if (imagePath != "")
      {
          &lt;p&gt;
          &lt;img src="@imagePath" alt="Sample" /&gt;
          &lt;/p&gt;
      }
  &lt;/form&gt;
  </code></pre>
  
  <p>This is called from a MainController.cs as so:</p>
  
  <pre><code>using Microsoft.AspNetCore.Mvc;
  
  namespace WebApp.Controllers
  {
      public class MainController : Controller
      {
          public IActionResult Pictures()
          {
               return View();
          }
      }
  }
  </code></pre>
  
  <p>There is also a _ViewStart.cshtml which references a _Layout.cshtml.</p>
  
  <p>When running this, I am redirected to my error page, and the terminal gives the error <code>The name 'Request' does not exist in the current context</code> </p>
  
  <p>Can somebody help point me in the right direction as to what I am missing or what I have done wrong?  Why does this tutorial example not work in the context of my project?</p>
  
  <p>Cheers :)</p>