homepage Welcome to WebmasterWorld Guest from 107.21.163.227
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Can you hide a link in a SiteMap, yet still show the breadcrumb on the SiteMapPath
sypa




msg:4209996
 3:31 pm on Oct 1, 2010 (gmt 0)


We have a dynamic sitemap and all nodes in the sitemap display a breadcrumb.

Is it possible to have the breadcrumb still showing, but make the link in the sitemap invisible or non-clickable?

Reason for this is that...
we dont want users to select some pages from the sitemap (becasue they need to conduct a search first to populate a datagrid) and clicking on the link will only take them to an empty page.


I tried just removing the url, or having a blank title, but that didn't work.

perhaps a stylesheet and set display=none or something..?

< siteMapNode title="my title"
description="my description"
url="~/folder/mypage.aspx" >
< / siteMapNode >

 

marcel




msg:4210673
 8:27 am on Oct 3, 2010 (gmt 0)

HI sypa, welcome to WebmasterWorld!

The asp:Menu control has an onMenuItemDataBound event where you can intercept the MenuItems as they are being added.

Here is a simple example of how to remove a specific MenuItem based on its Text value:

protected void Menu1_MenuItemDataBound(object sender, MenuEventArgs e)
{
// Check the MenuItem Title
if (e.Item.Text == "my title")
{
// Needs to be removed, check if it is a SubItem
if (e.Item.Parent != null)
{
// Remove from ParentNode
e.Item.Parent.ChildItems.Remove(e.Item);
}
else
{
// Remove from the Root of the Menu
Menu1.Items.Remove(e.Item);
}
}
}

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved