simple link disabling on current page

Discussion in 'ASP .Net Building Controls' started by jonefer, Feb 2, 2007.

  1. jonefer

    jonefer Guest

    Steve C Or has an article 'Automating Navigational Chores'--- .
    (which, don't get me wrong-- it's really nice, but I can't use the colorful
    panels for my business solution)

    Can someone help me remove the reference to the panels and just create
    simple Text hyperlinks?


    'loop through each child node

    'and create a hyerlink to the page.

    For Each Child As SiteMapNode In SMN.ChildNodes

    pnl.Controls.Add(New LiteralControl("&nbsp"))

    If Child.Url.Length > 0 AndAlso _

    SiteMap.CurrentNode.Url = Child.Url Then

    'if the link is to the current page

    'then don't display a hyperlink

    pnl.Controls.Add(New LiteralControl("<b>" & _

    Child.Title & "</b>"))


    'display a hyperlink to the page

    Dim h As WebControls.HyperLink = _

    New WebControls.HyperLink()

    h.NavigateUrl = Child.Url

    h.Text = Child.Title

    h.ToolTip = Child.Description


    End If

    CreateIcon(Child, pnl)

    pnl.Controls.Add(New LiteralControl("<br/>"))


    My site has a 'Member search' page and an 'Appointments' page... basically
    these - so far are the only links that I want to use a 'SiteMapPath' (bread
    crumbs) with.

    There are 2 other pages, a 'User Admin' and 'Control Panel' that I don't
    mind manually writing code to hide them.

    But I built a master page, and would like to use the SiteMap to determine a
    simple solution to disable the Member Search page - "FindMember.aspx" (which
    is also the home page) only show the Appointments link.. and Visa Versa (show
    the Member search link) when on the Appointments page.
    jonefer, Feb 2, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.