xxxxxxxxxx
Change the Contents of _ViewStart.cshtml file. You can also use if elseif statement.
xxxxxxxxxx
@{
string CurrentController = Convert.ToString(Context.Request.HttpContext.Request.RouteValues["Controller"]);
switch (CurrentController)
{
case "User":
Layout = "_New_Layout";
break;
default:
Layout = "_Layout";
break;
}
}
xxxxxxxxxx
Note: You can add as many case conditions as you want depending on your need.