2

I have a Treeview control which is currently outputting the results in an HTML table element, Ideally I would like to get this to output as an unordered List.

Something like <asp:TreeView RenderAsList="True"> would be great if possible. Of course if it were that easy I wouldn't be here!

Thanks in advance

2
  • I forgot to mention that I have no access to the code behind, I can only affect the ASPX Commented Feb 9, 2012 at 14:35
  • You could probably use javascipt to manipulate the DOM (jQuery is great for this) to turn your <table> into a <ul>. Sounds like it might be kind of a brittle solution though. Commented Feb 9, 2012 at 15:11

1 Answer 1

1

If you're wanting to make this an unordered list, I don't think you'll be able to do that using the normal Treeview control, what you could do is use a Repeater control that will let you build your list in html, and then use some jquery to format that list as a treeview.

http://bassistance.de/jquery-plugins/jquery-plugin-treeview/

if you "must" have the full asp:Treeview functionality there is an ancient library that hasn't been updated since 2006 that lets you render output of asp.net controls in a more css/html friendly fashion.

http://www.asp.net/cssadapters/

Sign up to request clarification or add additional context in comments.

1 Comment

Sadly it is a case of having to have the full Treeview. Thanks for the link it gives me something to investigate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.