How can I hide a user control on the master page from a content page? This is code I have on my content page’s load.
Dim banner As UserControl = DirectCast(Master.FindControl("uc_banner1"), UserControl)
banner.Visible = True
Does nothing for me 🙁
Expose the visible property of the user control via a property of the
MasterPage.In your
MasterPage:Then make sure to add a reference in your content page:
Then in your content page just do:
Edit: Since your using VB.net I used a code converter to convert it for you:
Content Page: