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. Advertisements

  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. Advertisements

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,556
    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,328
    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,605
    Keith Patrick
    Dec 18, 2005
  4. Dan

    SiteMapPath!

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

    siteMapPath beginner question

    Chris, Feb 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    476
    Chris
    Feb 24, 2006
  6. Not Me
    Replies:
    0
    Views:
    1,673
    Not Me
    Mar 16, 2006
  7. Replies:
    1
    Views:
    689
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Mar 21, 2006
  8. Danial
    Replies:
    1
    Views:
    3,976
    =?Utf-8?B?RFdT?=
    Apr 1, 2006
Loading...