Related to my comment -
Create a Table with ClientInfo in DB:
- Title
- BackgroundColor
- Language
- URL --> This has to be unique for this to work [client1, client2]. Don't save the full URL -- Just the Host
Let's say you are passing a Model --> LoginModel to your LoginPage.cshtml
public class LoginModel
{
public string UserName { get; set; }
public string Password { get; set; }
public StyleDTO ClientStyles { get; set; }
}
public class StyleDTO
{
public string Title { get; set; }
public string LogoPath { get; set; }
public string BackGroundColor { get; set; }
}
In your controller when you load View:
public ActionResult Login()
{
var clientUrl = HttpContext.Current.Request.Url.Host;
var cs = dbContext.ClientInfo.First(s => s.Url == clientUrl);
var model = new LoginModel()
{
ClientStyles = new StyleDTO()
{
Title = cs.Title,
LogoPath = cs.LogoPath,
BackGroundColor = cs.BackGroundColor
}
};
}
then in your login View (LoginPage.cshtml):
@model LoginModel
<div style="background-color: @Model.BackGroundColor">
<h1>@Model.Title</h1>
</div>