title: Route Data in Razor Pages
body: <p>I have a razor page call "app" in the default Pages folder.</p>
  
  <p>I can view this page just fine with <code>http://myapp.com/app</code></p>
  
  <p>Now I want to add a route parameter so the url looks like this:
  <code>http:/myapp.com/app/greg</code></p>
  
  <p>I want to extract <code>greg</code> from the URL and use it in the page.</p>
  
  <p>So I tried this:</p>
  
  <pre><code>HttpGet("app/{name}")]
  public void OnGet(string name)
  {
      //Do something with name.
  }
  </code></pre>
  
  <p>But I get a 404 error.</p>