Link to home
Start Free TrialLog in
Avatar of mgmhicks
mgmhicks

asked on

Why can't I find the node

I have a need to change the navigate URL of a treenode depending on the user group.  Here is the code I am using to find the node.

Dim myNode As New TreeNode
Dim myTest As String = "Carpet/Vinyl Install Dates"
myNode = TreeView1.FindNode(Server.HtmlEncode(mytest))
myNode.NavigateUrl = "~/Inspections/frmInstallDates2.aspx"

Open in new window


When I look at the locals  I can see this.


treeview1.Nodes(6).ValuePath      "Carpet/Vinyl Install Dates"      String

Yet the code above does not find the node.  Any ideas.

thanks
Avatar of kaufmed
kaufmed
Flag of United States of America image

Have you tried without the Server.HtmlEncode call?
Avatar of mgmhicks
mgmhicks

ASKER

Isn't that what I am doing in the code I sent?

myNode = TreeView1.FindNode(Server.HtmlEncode(mytest))


If it helps this code is on a master page
I am asking if you have removed that bit, and tried it simply as:

myNode = TreeView1.FindNode(mytest)

Open in new window

i'm sorry yea, that didn't work either.  Weird, cause node(6) has that valuepath
ASKER CERTIFIED SOLUTION
Avatar of mgmhicks
mgmhicks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I know you have got it working now but when you were trying to use FindNode, was PathSeparator property of the treeview set to "/"?
yes it is set to "/"