Multiple home page for different clients

devlopercsharp

New member
Joined
Jan 13, 2022
Messages
3
Programming Experience
10+
We have different clients asking for home page with different design layout so what is an efficient way to have multiple pages with different styles, layout for the same data coming from the database in a mvc project?
 
I'm assuming it's ASP.Net related.
If so then read up on View Engines for ASP; more specifically on how to create templates for that. The simpler route would be to keep things as close to traditional HTML and CSS as possible; because then styling can be adjusted without recompilation.
 
I'm assuming it's ASP.Net related.
If so then read up on View Engines for ASP; more specifically on how to create templates for that. The simpler route would be to keep things as close to traditional HTML and CSS as possible; because then styling can be adjusted without recompilation.
Thanks for the response. Yes, its asp.net, c#.Is it a good idea to have individual view(.cshtml) file for each client and associate the razor file name and client using a sql database table?
 
The correct way is to have a different branch in your source control for each client. Otherwise you can get into possibility that one client can access another clients page (either by accident, or through malicious intent). By keeping each client in a separate branch, and building that branch for a client specific release, you don't have any cross contamination.

But if you are willing to risk mixing multiple clients, then it's usually best just to have a single .cshtml and rotate around the .css where each .css file is named for a particular client. Also look around into Razor and/or your UI framework's supports for theming. You could have a theme per client.
 
The correct way is to have a different branch in your source control for each client. Otherwise you can get into possibility that one client can access another clients page (either by accident, or through malicious intent). By keeping each client in a separate branch, and building that branch for a client specific release, you don't have any cross contamination.

But if you are willing to risk mixing multiple clients, then it's usually best just to have a single .cshtml and rotate around the .css where each .css file is named for a particular client. Also look around into Razor and/or your UI framework's supports for theming. You could have a theme per client.
Agreed.

With templated html; its quite normal to break the task up into small bits that can be logically composed; how far the OP would need to take this is really going to depend on the extent of the level of customization differences amongst clients, for example:
  • CSS styling only would be consider fairly light customization, and similarly quite easy to accomplish.
  • Whereas customization of terminology, language, ... would be considered to be a lot more complex.
 
Back
Top Bottom