Maria Paz,
This is a bit tricky scenario. This feature is not supported out-of-box with
ASP.NET 2.0. I'm not sure how you can dynamically disable treeview nodes.
But i've found a work around for this. Instead of populating you treeview
with sitemap.xml, i populated with API's of Treeview. Using the API's you can
add or remove nodes during the fly. You can use this as the base to set up
the security trimming logic. Please refer the following snippet of code.
hope this helps !
// Let's assume this is the snippet for the administrator and
administrator
// has access to all the nodes
TreeNode tn1 = new TreeNode("First Node");
TreeView1.Nodes.Add(tn1);
TreeNode tn2 = new TreeNode("Second Node");
TreeView1.Nodes.Add(tn2);
TreeNode tn3 = new TreeNode("Third Node");
TreeView1.Nodes.Add(tn3);
TreeNode tn4 = new TreeNode("Fourth Node");
TreeView1.Nodes.Add(tn4);
// Lets assume this is the snippet for your under privileged user
// You dont want to display the nodes 2 and t
TreeView1.Nodes.Remove(tn2);
TreeView1.Nodes.Remove(tn4);