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.
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.