Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cutom nav provider - help on nodesCutom nav provider - help on nodes
Previous
 
Next
New Post
7/17/2007 1:41 AM
 

okay I am building acustom nav provider and based on some custom logic i need to remove nodes from the menu

The code I am using is very basic but having problems whan I remove a node - the last 4 lines are where i remove a node but if i remove a node then it seems to skip processing the next in line - in other words is shows it even if it is not supposed to be shown - now I see why but nbot sure how I am supposed to fix it - the current node is removed so it doesnt seem to understand where it is in the node collection  - how do I fix or revise doing this

                     For Each objNode In objNodes
                        Dim myTest As Boolean = False
                        For Each ATabID As Integer In MyListAppTabs
                            If ATabID = Convert.ToInt32(objNode.ID) Then
                                myTest = True
                            End If
                        Next
                        If myTest = False Then
                            objNodes.Remove(objNode)
                        End If
                    Next


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
7/17/2007 2:32 PM
 

removing nodes while enumerating them generally leads to bugs.  A safer way to do it would be start from the end and work to the front.

For index As Integer = objNodes.Count - 1 To 0

...


 
New Post
7/17/2007 6:22 PM
 

yeah tried that now and i am still getting errors

I added the nodes i want to a new dnn nodes collection but i lost all teh hieararchy why would that happen?

sorry more info

so for example I have a user admin area open to certain roles

Admin

          User Admin

          Location Admin

It now appears as a straight line

Admin        User Admin        Location Admin


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cutom nav provider - help on nodesCutom nav provider - help on nodes


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out