title: How to redirect to an action in another area in ASP.NET Core 2.1
body: <p>I tried the following code to redirect from an action in the default area to an action in the ControlPanel area:</p>
  
  <pre><code>return RedirectToAction(nameof(Areas.ControlPanel.Controllers.HomeController.Index),
                              nameof(Areas.ControlPanel.Controllers.HomeController).Replace("Controller", ""),
                              new { area = nameof(Areas.ControlPanel) });
  </code></pre>
  
  <p>but it produces this url in the browser:
  <a href="https://localhost:44360/Home/Index?area=ControlPanel" rel="nofollow noreferrer">https://localhost:44360/Home/Index?area=ControlPanel</a></p>
  
  <p>while it want it to be: <a href="https://localhost:44360/ControlPanel/Home/Index" rel="nofollow noreferrer">https://localhost:44360/ControlPanel/Home/Index</a></p>
  
  <p>Any ideas how I can fix it?</p>