Search code examples
asp.netvb.netanchordisable-link

How to disable html anchor tag of master page in other page?


My master page has anchor tag,which i want to disable on other page.But the disable property of anchor tag does not work.

Below is the code i have used.

Dim LinkLogout As HtmlAnchor
LinkLogout = CType(Master.FindControl("LogOutLi"), HtmlAnchor)          
LinkLogout.Disabled = True

Solution

  • I got the way to disable completely an anchor tag:

    Dim LinkLogout As HtmlAnchor
    LinkLogout = CType(Master.FindControl("LogOutLi"), HtmlAnchor)
    LinkLogout .HRef = "javascript:void(0)"