How to disable the links in sitemappath?

Discussion in 'ASP .Net' started by Swati Jain, May 3, 2007.

  1. Swati Jain

    Swati Jain Guest

    Hello all,
    can you please tell me how to disable links in SiteMapPath? I need it to show a path only without any links. RenderCurrentNodeAsLink = False is not enough.
    Swati Jain, May 3, 2007
    #1
    1. Advertising

  2. One option is to handle the ItemDataBound event of the SiteMapPath:

    if (e.Item.ItemType == SiteMapNodeItemType.Parent || e.Item.ItemType ==
    SiteMapNodeItemType.Root)
    {
    ((HyperLink)e.Item.Controls[0]).NavigateUrl = "";
    }

    Note that the above code assumes you have set RenderCurrentNodeAsLink to
    false and the index value (zero above) may change if you have nested controls
    in your node template.

    "Swati Jain" wrote:

    > Hello all,
    > can you please tell me how to disable links in SiteMapPath? I need it to show a path only without any links. RenderCurrentNodeAsLink = False is not enough.
    >
    >
    >
    =?Utf-8?B?U2l2YSBN?=, May 3, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    3
    Views:
    3,354
    clintonG
    Oct 3, 2005
  2. Robert Camsky

    SiteMapPath Control and dynamic items

    Robert Camsky, Oct 15, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    6,099
    clintonG
    Oct 16, 2005
  3. =?Utf-8?B?aXNhY2MgbWFuaXQ=?=

    SiteMapPath

    =?Utf-8?B?aXNhY2MgbWFuaXQ=?=, Dec 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,445
    Keith Patrick
    Dec 18, 2005
  4. Dan

    SiteMapPath!

    Dan, Jan 17, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    527
    Chilá
    Jan 17, 2006
  5. Chris

    siteMapPath beginner question

    Chris, Feb 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    402
    Chris
    Feb 24, 2006
Loading...

Share This Page