Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i use url in child node in treeview asp.net c# web.

What I have tried:

Here i try :
parentNode.ChildNodes.Add(new TreeNode("More").Navigateurl="home.asp");
But error come,it's not working ...Kindly tell me how can i use url
Posted
Updated 2-Apr-16 7:21am

1 solution

try this
C#
var temp = new TreeNode("More") {  NavigateUrl = "~/home.asp" };
           parentNode.ChildNodes.Add(temp);

Make sure that the home.asp page is in root (top) folder of your solution.
 
Share this answer
 
v2
Comments
Hameed Khan 2-Apr-16 13:34pm    
home.aspx page is in root (top) folder of your solution.HOW CAN I DO IT?
Karthik_Mahalingam 2-Apr-16 13:35pm    
check my updated solution.
Hameed Khan 2-Apr-16 13:44pm    
Thankss it's working now..great buddy
Karthik_Mahalingam 2-Apr-16 13:48pm    
welcome :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900