Link to home
Start Free TrialLog in
Avatar of deeisner
deeisner

asked on

Accessing ASP.NET TreeView Node Attributes

Does anyone know if there is a way to access the innerHTML or innerText properties of a TreeNode object?

There are only a few methods accessible for the Nodes of a TreeViewNodes object collection including Text, NavigateURL, ImageURL and Target. But I am wanting to add a custom attribute to the Node (not TreeView) level such as "rel=nofollow" to the Node's <a> tag.

There seems to be no way to do this on the Server side.

Does anyone have a solution that might work on either the Server or Client script side?

Thanks
Avatar of Juan_Barrera
Juan_Barrera
Flag of New Zealand image

I think that YourTreeView.Node(yourNode).Attributes.Add("rel","nofollow") should work.
Avatar of deeisner
deeisner

ASKER

no, there is no Attribute or Attributes property at the TreeNode level. Only for the container TreeView object. Thanks though
ASKER CERTIFIED SOLUTION
Avatar of Juan_Barrera
Juan_Barrera
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great idea, thank you.