Posted on: 4/15/2011 9:20:51 PM | Views : 374

Is there a way to determine on pageload which MasterPage to use with a page?

In my code behind I want to do the following:

protected void Page_Load(object sender, EventArgs e)
    {

        bool bAccess = ThisSite.Function.ValidateUserAccess(Session["UserID"].ToString(), "Commissioning");
       
if (bAccess == true)
        {
            CHOOSE MASTERPAGE_A;
        }
else
    {
            CHOOSE MASTERPAGE_B;
        }

My ASP directive looks as follows:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage_B.master"
    AutoE ...

Go to the complete details ...