Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Dynamically Setting MasterPages C#

Let's say that I have a single IP address with multiple domains pointing to it. Each DNS corrosponds to a different skin that I would set up using Master Pages.

1. Where would be the best place to place to put the logic that checks the domain name and then set's the MasterPage file. (Page_Load or Global.asax)

2. How do you dynamically set the MasterPage. I am having problems setting it using:

this.MasterPage = ""; //From within Page_Load()

3. Is MasterPages the best thing to use to accomplish this tasks, or does .Net 2.0 have another solution for this that may work better?

Alex
[647 byte] By [hoyaabanks] at [2007-11-11 7:18:44]