title: Redirect to Page with ID in Razor Pages
body: <p>I'm trying to get my app to redirect to the previous page after it updates the database but I can't seem to figure it out. What's complicating it is that the previous page isn't just a simple page. It's populated with information pulled but a specific row in the database so the URL has </p>
  
  <blockquote>
    <p>blah blah blah.../ProjectDetails?id=(the ID number)</p>
  </blockquote>
  
  <p>I've tried using the Redirect Methods but they aren't as straight forward as I'd hoped. Can someone help me figure out how to go back to the previous page?</p>
  
  <p><strong>View</strong></p>
  
  <pre><code>        &lt;form method="post"&gt;
              &lt;select class="custom-select mb-4 col-6" name="Assignee"&gt;
                  &lt;option&gt;John&lt;/option&gt;
                  &lt;option&gt;Jane&lt;/option&gt;
                  &lt;option&gt;Jim&lt;/option&gt;
                  &lt;option&gt;Juju&lt;/option&gt;
              &lt;/select&gt;
              &lt;br&gt;
              &lt;button type="submit" class="btn btn-info"&gt;Save&lt;/button&gt;
              &lt;a class="btn btn-danger" asp-page="./Teamlead"&gt;Cancel&lt;/a&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p><strong>Code Behind</strong></p>
  
  <pre><code>public async Task&lt;IActionResult&gt; OnPostAsync(int id)
          {
              Submission = _SubmissionContext.Submissions
                              .Where(s =&gt; s.ID == id).First();
              Submission.AssignedTo = Assignee;
              await _SubmissionContext.SaveChangesAsync();
  
              return RedirectToRoute("./ProjectDetails"); //PROBLEM HERE
  
          }
  </code></pre>