Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 24th, 2007, 02:41 PM
Authorized User
 
Join Date: Aug 2007
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default What about subcategory option in articles?

Did anyone figure out how to make the additional SUBCATEGORY option for the ARTICLES? Marco mentioned about it in the book with the tip about additional field "SubCat" in the Category table, but did not go on :-). Actually, I'm interested in the unlimited levels of children in the ARTICLES (example: Room-->Wall-->Shelf-->Book-->Chapter-->Page-->Line-->Letter). Can anyone help with this?

 
Old August 24th, 2007, 06:31 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to implement that too...

On Category table I just have:
ID
ParentCategoryID
Name
Description
ImageURL

My problem is on admin pages...
I think I will use an tree menu!

on the user-end pages it's simple:
If the url is www.xxxx.com/showArticles.aspx?categID=2:
 On the top of the page I'll put one repeater (or something like this) for return all subcategories that have "ParentCategoryID = 2"

Next i will show a gridview with all articles that has "categoryID = 2"

If you have another idea please tell us!

 
Old September 14th, 2007, 10:19 AM
FT FT is offline
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Maxxim
I am too trying to make this, but I am having some problems on how to write the code.
So if you have complited it can you post the code

Thanks

 
Old September 14th, 2007, 05:30 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No i can't... :(
I worked on this code from past two weeks... But the first reason is because I added more stuff than simple n-level category and i had changed all my sql structure (names, etc)
If i put the code here, you might be confused...

But i'm free to help you...

I created n-level category and an upper level "sectionID"... because i'm building a "mega portal"
(you don't need section id (i suppose)
First add one column to your categories table: "ParentID"

Then modify your dal, bll code in order to show categorys and subcategories...
I used a treeview!

You may see this topics if you want:

http://p2p.wrox.com/topic.asp?TOPIC_ID=64640

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89365

Before you start making some changes don't forget backup!



 
Old September 16th, 2007, 10:17 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

I have an example of how to use Common Table Expressions in my blog. They are by far the easiest way to deal with hierarchical data.

(It's similar to what is described in the sqlteam example).

http://entropia-online.blogspot.com/
 
Old September 16th, 2007, 12:07 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

But do this with sql isn't the hard stuff!

The challenge it's to do all the necessary stuff in TBH UI and BLL.

 
Old September 17th, 2007, 12:39 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Not really ;)

Just use a CTE within your stored procedure to give you back the resultset you want. The principle would remain the same, you might just have to add a parameter or so...

http://entropia-online.blogspot.com/
 
Old September 17th, 2007, 01:05 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that too... before I started to make my UI pages... :)

I tried to datasource my treeview with this select, But i got an error because treeview needs to bind with a hierarchical datasource...
I had two choices...
Get my SELECT from DB and create a xml file and then bind the treeview
Or
Catch a list with the select and then bind my treeviewNodes father my father...
I preferred the second choice because I want to add custom links to my treeView!

It wasn't easy... There no custom treeview samples on the web...
I'm on a middle of forums Creation so... when I debug my application I PrintScreen my ArticlesCategories for you see...

I created too an hierarchical ArticlesAuthor section.

Groups...
 Author

I'm creating a dog's portal.
I will have articles from handlers, breeders, doctors, etc...
I want that user can have the option to see all articles byAuthor, byAuthorGroup, byCategory, bySubCategory...

(forgive my bad english...)


 
Old September 17th, 2007, 02:55 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hmm. Interesting point... I have my CTE implemented in my database. If i have some spare time, I will try playing around with something similar at work tomorrow to see if I somehow can get it working somehow.

Cheers,

Peter

http://entropia-online.blogspot.com/
 
Old September 19th, 2007, 06:45 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

interesting atricle on flixon (september 18th) re creating a little user function in sql to allow recursive (safe) querying of sub-categories:

http://www.flixon.com/

jimi

http://www.originaltalent.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Multilevel unlimited subcategory ? atul PHP Databases 0 September 22nd, 2007 12:37 AM
Wrox.com C# articles jminatel C# 2005 0 March 23rd, 2007 08:43 PM
Recent articles not showing on articles page kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 December 16th, 2006 10:06 AM





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