473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to hide some map nodes from menu

I have web.sitemap file that is used in sitemappath control. I also have a
menu that uses the same sitemap file. is it possible to "hide" some nodes
from menu but still have them available for SiteMapPath control.
I need it since some pages could be displayed only if the have some
parameters passed to them via url.
Thank you,
Shimon.
Mar 27 '06 #1
3 2492
Simon,

Use the OnMenuItemDataBound event and you can check which node you're on by
looking at the menu item's text.

Protected Sub Menu1_MenuItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemDataBound

Try

If e.Item.Text = "Page2" Then
'---Don't show page2
e.Item.Text = ""
End If

Catch ex As Exception

ProcessException("There was an error during menu creation:", ex)

End Try

End Sub

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uD**************@TK2MSFTNGP10.phx.gbl...
I have web.sitemap file that is used in sitemappath control. I also have a
menu that uses the same sitemap file. is it possible to "hide" some nodes
from menu but still have them available for SiteMapPath control.
I need it since some pages could be displayed only if the have some
parameters passed to them via url.
Thank you,
Shimon.

Mar 27 '06 #2
OK.
This is kind of solution.
Is there a way to do this just by using sitemap file? This way it will be
easier to manage the whole thing.
Thanks.

"S. Justin Gengo" <justin@[remove to send mail]aboutfortunate.com> wrote in
message news:uD****************@TK2MSFTNGP09.phx.gbl...
Simon,

Use the OnMenuItemDataBound event and you can check which node you're on
by looking at the menu item's text.

Protected Sub Menu1_MenuItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemDataBound

Try

If e.Item.Text = "Page2" Then
'---Don't show page2
e.Item.Text = ""
End If

Catch ex As Exception

ProcessException("There was an error during menu creation:", ex)

End Try

End Sub

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Shimon Sim" <sh**********@community.nospam> wrote in message
news:uD**************@TK2MSFTNGP10.phx.gbl...
I have web.sitemap file that is used in sitemappath control. I also have a
menu that uses the same sitemap file. is it possible to "hide" some nodes
from menu but still have them available for SiteMapPath control.
I need it since some pages could be displayed only if the have some
parameters passed to them via url.
Thank you,
Shimon.


Mar 27 '06 #3
Hi Shimon,

So far I think Justin's suggestion would be preferred since that approach
just focus on the Menu control's rendering. And actually the task you need
to do require the customization on multiple layers from sitemap provider to
site map controls. the default Site map provider(xml file) only support
show/hide nodes depend on role setting. If you want to do it at
configuration file level and make the visibility different between
different controls, we need to customize both the sitemapprovider and the
certain site map controls.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Mar 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
1
by: Nancy Shelley | last post by:
Hi all: I am building a navigation menu using telerik's rad treeview I am able to build the outer menu but not the children. How do I select the child nodes (item) from within the loop? Any...
8
by: Mikey | last post by:
I have an XML document as follows: <Menu> <Group> <Item Text="About Us" AccessRoles="All"> <Group> <Item Text="Option 1" AccessRoles="All" /> <Item Text="Option 2" AccessRoles="All" /> <Item...
0
by: Danny Tuppeny | last post by:
Hi all, I'm using a web.sitemap file and the site navigation controls. I've got a page (ListRecords.aspx) that contains a grid, from where you can click through to another page...
2
by: jeet_sen | last post by:
Hi, I have created a table colelcting data from an XML source. After I built the whole table I ahve given user options to filter out columns from the table. For this I have collected all the...
11
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
2
by: Daves | last post by:
my 2.0 menu control has this root node which I want to hide normally the showrootnode property is set to false on the sitemapdatasource for the menu but I am actually populating it my self from a...
0
by: jotaefe | last post by:
Hi, Is it possible to hide the root node in a treeview without editing the original xml? To populate the xml file, I am using this functions: private void PopulateTree(TreeView...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.