title: How to redirect to area after login asp.net core 3.0?
body: <p>I have created a new area called Principal, also I have created in this area a controller called Principal and a view called index. I need to show this view afer user login. Please help me.</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; OnPostAsync(string returnUrl = null)
  {
      returnUrl = returnUrl ?? Url.Content("~/");
  
      if (ModelState.IsValid)
      {
          // This doesn't count login failures towards account lockout
          // To enable password failures to trigger account lockout, set lockoutOnFailure: true
          var result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: true);
          if (result.Succeeded)
          {
              _logger.LogInformation("User logged in.");
              return LocalRedirect(returnUrl);
          }
          if (result.RequiresTwoFactor)
          {
              return RedirectToPage("./LoginWith2fa", new { ReturnUrl = returnUrl, RememberMe = Input.RememberMe });
          }
          if (result.IsLockedOut)
          {
              _logger.LogWarning("User account locked out.");
              return RedirectToPage("./Lockout");
          }
          else
          {
              var user = await _userManager.FindByNameAsync(Input.Email);
              if (user == null)
              {
                  ModelState.AddModelError(string.Empty, "Invalid UserName.");
              }
              else if (!await _userManager.CheckPasswordAsync(user, Input.Password))
              {
                  ModelState.AddModelError(string.Empty, "Invalid Password.");
              }
              return Page();
          }
      }
  </code></pre>
  
  <p>This is controller</p>
  
  <pre><code>[Area("Principal")]
  public class PrincipalController : Controller
  {
      public IActionResult Index()
      {
          return View();
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ajn4n.jpg" rel="nofollow noreferrer">enter image description here</a></p>