I have these variables set on my MasterPage
public string CurrentUser = "";
public string UserDomain = "";
protected void Page_Load(object sender, EventArgs e)
{
string Name = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
string[] userDetails = Request.LogonUserIdentity.Name.Split(new string[] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
UserDomain = userDetails[0];
CurrentUser = userDetails[1];
}
In a child page I am simply trying to read those values back:
CurrentUser = ((SiteMaster)Page.Master).CurrentUser;
UserDomain = ((SiteMaster)Page.Master).UserDomain;
They are always coming back empty. I can see that they are set correctly on the Master page but they get lost on the way to the content page.
What am I doing wrong?