Best practice for loading different themes or css files for different users in ASP.NET MVC -


there 2 questions:

  1. how routing different customers under same domain e.g. customer url looks like: http://cusa.mydomain.com customer b url looks like: http://cusb.mydomain.com

  2. and according different url(the above urls) load different themes.

for question 1: know have sub-domain concept talking more : www.mydomain.com/cusa , www.mydomain.com/cusb. don't know whether capable of doing sub-domain in front of mydomain

for question 2: if question 1 gets solved, think read , parse url , loading different themes according cusa or cusb part using asp.net mvc theme stuff.

could provide thoughts , technologies use in case?

thank you.

update:

tried use "request.applicationpath" doesn't work.

here code

<h2>site 2 home page</h2>  <a href="/home/contact">go contact</a> <label>the application path @request.applicationpath.substring(1)</label> 

my answer not best practice, rather how have approached in our product.

we have multiple sites running of same application binaries, each in different application pool on server. each web-share has config- , css file corresponding name of share. use config- , css files based on application's name on server (i.e. request.applicationpath).

in case, have web-share named cusa , named cusb. have css files named cusa.css , cusb.css respectively. can include css file based on name of application...

an example of including stylesheet might follows:

<link href="<%=request.applicationpath.substring(1)%>.css" type="text/css" rel="stylesheet" /> 

that link "cusb.css" if web-share's name "cusb". above snippet needs included in view style include, view engine use influence syntax bit.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -