title: ASP.NET Core 2: how to RedirectToPage with area?
body: <p><code>RedirectToPage("Companies")</code> will redirect to <code>/Pages/Companies.cshtml</code> (from an ASP.NET MVC controller)</p>
  
  <p>But what if want redirect to this page <code>/Areas/MyArea/Pages/Companies.cshtml</code> ?</p>
  
  <p>All those and many others don't work:</p>
  
  <pre><code>RedirectToPage("/MyArea/Companies.cshtml") 
  RedirectToPage("MyArea/Companies.cshtml") 
  RedirectToPage("./MyArea/Companies.cshtml") 
  RedirectToPage("/MyArea/Companies") 
  RedirectToPage("MyArea/Companies") 
  RedirectToPage("./MyArea/Companies") 
  </code></pre>
  
  <p>Sometimes I get "Page not found" error. Sometimes get "Specify a root relative path with a leading '/' to generate a URL outside of a Razor Page". There are no <code>Pages</code> folder. I know  all this can change all rules again.</p>
  
  <p>P.S. Razor pages configred with plain .SetCompatibilityVersion(CompatibilityVersion.Version_2_1); no specific routing added.</p>