This question is locked. New answers and comments are not allowed.
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
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?
/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?