Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2006, 12:43 PM
Registered User
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CMS: Bind Nav Data to Treeview/Menu controls

Hi Imar,

Great book, BTW.

I'm looking for the simplest path to binding the Nav Data to an XmlDataSource (..ObjectDataSource?) to serve to treeview/menu controls, vs. the current two repeaters in the SiteMenu.ascx.

I've created a (mostly) functional example with a relational dataset bound to XmlDataSource, transformed via .xsl file. It's probably more complicated than it needs to be- and xsl is still quite foreign to me.

Might you have any suggestions/overview of the most logical way to do this?

FWIW- I'm also thinking that a single, self-referencing table to store ContentType/Category data.. along with appropriate business/presentation mods, could provide unlimited category levels. Ultimately, I'll rewrite friendly urls.. (which I'm surprised nobody has mentioned yet)

Your comments would be greatly appreciated!

B



 
Old August 26th, 2006, 03:16 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You have a few options. One is to stick with the XSL file. I am not too good with XSL to I can't recommend much to improve your code.

Alternatively, you can use the SiteMap file and provider. This control displays hierarchical data by default. You could write a physical copy of the site map whenever you make a change in the categories in the system.

Finally, you can indeed use a relational dataset with a self referencing column. You could write a recursive method that loops through this dataset and manually adds nodes to the TreeView at the requested level. I have done that a while ago, so I can assist you with it if you need some help.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old October 25th, 2007, 01:46 PM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar

I realize this post is quite old but i am interested in setting up a self referencing table to allow for unlimited categories. If you could provide me an example or a starting place on how to setup the recursive method for the treeview and any other help would be most appreciated.

Thanks again and great book btw!
Adam



 
Old October 25th, 2007, 02:33 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Adam,

I haven't tested the code in this article, but it looks like it does what you need: http://www.codeproject.com/aspnet/Au...ngTreeView.asp

If you need more help, let me know. I don't have the time right now to dig up the old code I was referring to (can't even recall where I used it, to be honest...

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox CMS - Altering the menu controls Eriskyne BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 October 15th, 2007 12:34 PM
How to bind Gridview with controls hyder_master .NET Framework 2.0 0 October 5th, 2007 05:01 AM
Data Bind Template Controls in Gridview wirerider ASP.NET 2.0 Basics 5 February 4th, 2007 07:20 AM
Bind result set to Html Div Controls jazzcatone ASP.NET 1.0 and 1.1 Basics 1 August 10th, 2006 07:35 AM
How to bind colors to controls in an formview leverell ASP.NET 2.0 Professional 0 May 31st, 2006 02:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.