Reputation: 570
I have Web Forms project of the application and the client wants to have that same project done in multiple versions, (basic, plus and pro). So basicly, when somebody is at the url www.basicdonations.com, the same code will handle as if the request was sent from www.plusdonations.com or www.prodonations.com, but the way they handle pricing and other stuff is suited according to the level of site.
Where to set up handling this? How will Web Forms project know and tell the difference between which of these hostnames sent a request, and where to put the logic to decide which page to show up.
I thought of setting up every page in three different versions, they are similar, but have some changes. Is there a better option, like having some part of the code dynamically decide which parts of the page are going to be rendered?
Upvotes: 0
Views: 39
Reputation: 459
You could use Request.Url.Host to distinguish between the sites. Something like:
switch (Request.Url.Host)
{
case "www.plusdonations.com":
//setup pricing for plus
break;
case "www.prodonations.com":
//setup pricing for pro
break;
case "www.basicdonations.com":
//setup pricing for basic
break;
default:
//handle other hosts
break;
}
Upvotes: 1