I have two different login pages in my MVC project, and depending on which URL is used to access the site the relevant login page needs to display (specific client requirements).
I am able to define which _layout
is used based on the name of the login page in the _ViewStart
:
if (Context.Request.Path.Contains("LoginG"))
{
Layout = "~/Views/Shared/_LayoutG.cshtml";
}
else {
Layout = "~/Views/Shared/_Layout.cshtml";
}
But how can I set the initial view/landing page based on the URL?
Or can this be done in IIS?
Note: Both the login pages are actually identical other than the name, as the only reason I had to give it a different name was in order to apply the different layout in the _ViewStart
!