This is a migrated thread and some comments may be shown as answers.

[Solved] Nodes set with querystring parameters instead of routevalues

0 Answers 148 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dewey
Top achievements
Rank 1
Dewey asked on 13 Sep 2012, 06:06 PM
I have a five-level MVC TreeView which I am binding to a IEnumerable<TreeViewItem>. For the top three levels, the nodes will navigate to a URL such as:

/root/Accounts?type=1&category=2

when they should instead utilize route values and point to a URL such as:

/root/Accounts/1/2

In other words my code
node.RouteValues.Add("type", row.Type);
node.RouteValues.Add("category", row.Category);

isn't generating the correct route values, just querystring parameters.

However, if I click on nodes for the fourth and fifth levels of the tree, the URL is rendered correctly, such as:

/root/Accounts/1/2/4/7/12

Do you have any clue what might be causing the inconsistent behavior?
Tags
TreeView
Asked by
Dewey
Top achievements
Rank 1
Share this question
or