title: How to redirect to a asp.net core razor page (no routes)
body: <p>Here I have a razor cs page:</p>
  
  <pre><code>public IActionResult OnPost(){
    if (!ModelState.IsValid) {
      return Page(); 
    }
  
    return RedirectToPage('Pages/index.cshtml'); 
  
  }
  </code></pre>
  
  <p>And a cshtml page:</p>
  
  <pre><code>@page
  @using RazorPages
  
  @model IndexModel
  &lt;form method="POST"&gt;
    &lt;input type="submit" id="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to redirect to the same page on form submit but I keep getting 400 error. Is it possible to do the redirect without using routes and just go to cshtml file in the url?</p>