簡體   English   中英

在VB母版頁中的另一個頁面中隱藏文本鏈接

[英]Hide the Text Link in another page which is in Master Page in VB

我是母版頁的新手。 根據我的項目,我需要將文本鏈接隱藏在母版頁中的另一個頁面中。 那么如何將文本鏈接隱藏在另一個頁面中。 我嘗試了多種方法,但我無法得到它。 所以,請任何人幫忙。

假設:在母版頁中,我們有 GotoHome 鏈接。 當我們點擊主頁時,它不應該在那里。 那么如何在主頁中隱藏 GotoHome 鏈接。

我曾經用“a href”顯示那個gotohome。

提前致謝。

您可以使用 Me.Master.FindControl 引用頁面 MasterPage 上的控件。 這是假設控件直接在頁面上而不是在命名容器內,例如 FormView。

Public Class Test
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        CType(Me.Master.FindControl("hl_YourHyperlink"), HyperLink).Visible = False
    End Sub

End Class

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM