2010-03-31 34 views

回答

1

如果您将超链接作为母版页上的属性公开,您可以获取对页面母版的引用并将其转换为您的特定母版页,然后使用该属性设置对超链接的可见性。

在你的母版页有这样的事情:

Public ReadOnly Property RemitViewerLink() As HyperLink 
    Get 
     Return hlRemitViewer 
    End Get 
End Property 

然后在你的子页面,你可以做到这一点

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load 
Dim MyMaster As MasterPage = DirectCast(Page.Master, MasterPage) 
    MyMaster.RemitViewerLink.CssClass = "selectedMenuItem" 'or set visibility 
End Sub 
0

没有,如果你设置可见= false,那么它甚至不会在页面的HTML输出显示。您需要使用JavaScript来隐藏/显示超链接。