entity framework - Separate subdomain for each client -


let's have table user , table products:

name        company john doe       1 alex doe       2 michael doe    1  productname company   tea            1 coffee         1  companyid   companyname    1         comapny1      2         company2  

now want have separate login companies @ company.mydomain.com , company2.mydomain.com, etc.

clients register subdomains themselves. allow me show separate list of products each subdomain. best way this? should use routing? or use javascript replace domain fake domain name? (i'm using simplemembership)

  1. you can set "appdomain" roles.applicationname. if set: roles.applicationname = "company", roleprovider working subset of roles application=company. similarly, can set roles.applicationname = "company2".

  2. unfortunately, roles static object, roles.applicationname static property.

    "your entire asp.net mvc application runs within appdomain, application plus requests being served users, everything!!

    when create static variable, single instance declared , made available entire appdomain, every request every user see same value."

    problem static variable

    so, must lock thread while run authorize, or you can write own role provider.

  3. you can make routing based subdomain.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -