How do i access a masterpage hyperlink control from a content page in asp.net 4.0 using vb?

:o
Oh i guess i came to the wrong forum for help
Goodbye then..

Hello-

To access a control in the master page, here is one approach.

The code isnt tested, just writing from memory..

VB.NET

Dim cph As ContentPlaceHolder = DirectCast(Me.Master.FindControl("ContentPlaceHolder1"), ContentPlaceHolder)
Dim hyp As Hyperlink = DirectCast(cph.FindControl("hyperlinkId"), Hyperlink)
hyp.Visible = True

C# (for anyone else that may come accross this)

ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
Hyperlink hyp = (Hyperlink)cph.FindControl("hyperlinkId");
hyp.Visible = true; 

Give it a try and report back if it worked for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.