Feb 01, 2020 09:52 AM|jalali|LINK
For some reasons I have to Redirect my page from Account Controller -> Login method to
Home Controller -> Index method. That's what I am doing.
public class AccountController : Controller
public ActionResult Login()
return RedirectToAction("Index", "Home");
My problem is when the redirect happens the layout page used by the Razor View Engine is the same used by
Login Action Method. not the one used by Index Logically, when we Redirect the Razor engine should use the New Layout page defined in the
ViewBag.Title = "Home Page";
Layout = "~/Views/Shared/_Layout.cshtml";
Can anybody help me with this?