Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview breaks when you use physical path for link

Status
Not open for further replies.

stevet26

Programmer
Feb 9, 2005
53
Hi

I have a treeview control which gets it values from a database. Up until now it has worked fine as all the links in the tree have been going to virtual paths like: default.aspx?ID=1.

My client has now asked that we include a press realeases section to the tree which links to external pages: and the tree view then breaks saying

' not a valid virtual path.'
the line it breaks on is AddNode(node, GetParentNodeFromDataReader(reader));

Does anyone have any idea why this is happening?

I am working with visual web developer 2005 and working with asp.net 2.

Thanking you in advance
 
Does anyone have any idea why this is happening?
Yes, because the method you have called only accepts a virtual path which isn't what you have supplied.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Great. So is there a method I could call to make it work?
 
Yes, TreeNodes have a NavigateURL property so when you add your Node, use of one the overloaded functions e.g.
Code:
TreeView1.Nodes.Add(New TreeNode("Example Text", "Example Value", "c:\image.jpg", "[URL unfurl="true"]http://aspnetlibrary.com",[/URL] ""))


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top