Dynamic TreeView control in Master Page

Joined
Nov 1, 2006
Messages
3
Reaction score
0
I have a treeview control (named MenuTree) in my master page. I need to generate it programmically depends on the user login. I have sitemap for generating the menu.

How can I implement it using sitemap.
I tried to create roles and attached the roles in <sitemapnode> but its not working.
I tried to create a function for generating node automatically depends on the user login. Its working but the problem is, if I clicked on a particular node, it will display the corresponding page.

for example:

protected void MenuTree_SelectedNodeChanged(object sender, EventArgs e)
{
if (MenuTree.SelectedNode.Text == "Product")
{
// Server.Transfer("Products/ProductStatus.aspx");
Response.Redirect("Products/ProductStatus.aspx");
}
else if (MenuTree.SelectedNode.Text == "Profile")
{
Server.Transfer("Profile/MyProfile.aspx");
}

}

if I clicked on profile, it will display MyProfile.aspx in the first time. but if I click again in the same node, it is searching again Site/Profile/Profile/MyProfile.aspx.
If I clicked on Product node, it is checking "Site/Profile/Products/ProductStatus.aspx. It is not checking from root node.
I tried to give relative path like ../Product/ProductStatus.aspx and
~Site/Product/ProductStatus.aspx. but both are not working in some conditions.

Any body has idea about it. pls help me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top