I'll try and explain this as best as I can.
I've got a PopUp live chat box which is displayed via PageInit on every page via ASP.NET Master pages. When I hide the popup box from showing via PageLoad on a certain page's code behind, it will then not reappear on other pages despite having it set to show on the master page's PageInit.
Master Page:
public bool ShowLiveChat { get; set; }
protected override void OnInit(EventArgs e)
{
ShowLiveChat = true;
}
Code Behind of concerned page:
protected void Page_Load(object sender, EventArgs e)
{
((CommonHeaderAndFooter)Master).ShowLiveChat = false;
}
public bool ShowLiveChat { get; set; }
is global object here. After initializing on the master page, it is getting Loaded on concerned page where its visibility is set to false which also affects on master page and that's why you are not able to see it on any page.
Check the ASP.NET Page Life Cycle Overview