do a redirect into a view Asp.net core
//In this exemple i am doing a a login verification
@{
@if (SignInManager.IsSignedIn(User))
{
//Do a redirect if its loggedIn
Context.Response.Redirect("~/Account/LogIn?returnUrl=Products");
}
else
{
//If isn't logged in
Context.Response.Redirect("~/Identity/Account/Login");
}
}
//If u just wuant to do a redirect out of a context u dont need to say what's
//current conext
@Response.Redirect("~/Account/LogIn?returnUrl=Products");