The best way to do this would be to have a public property on the master page. this property can change the visibility of the controls and you can use this property from child pages conditionally.
see this example:
in my master page i have (
RightSide
is name of a Panel in my master page)
public bool SidePaneVisibility
{
get
{
return RightSide.Visible;
}
set
{
RightSide.Visible = value;
}
}
and I am using it from my content page conditionally as:
if (Session["UserId"] == null)
{
MasterPage master = (MasterPage)this.Master;
master.SidePaneVisibility = false;
}