I have parent nodes and child nodes and child nodes have sub childs like that i have inifinite child

Posted by kallamjreddy-17301 under C# on 10/7/2012 | Points: 10 | Views : 1122 | Status : [Member] | Replies : 1
HI There,

i have a table in database and my requirement is to bind all the items present in database to a menu.
i need to bind all those to my menu Please some body help me out
My data should be like

Home Products

SubHome1--->Sub_SubHome1 ..... SubProducts1----->Sub_SubProducts1

SubHome2---->Sub_subHome2..... SubProducts2-----...........................

................Like this i have unlimited N-Nodes have to bind them.

I need a recursive funcitionality.

My Table Looks Like

MenuId MenuName ParentId MenuUrl MenuImage(if any)

1 Home 0 HomwUrl HomeImage
2 Products 0 ProductsUrl ProductsImage
3 Categories 0 CategoriesUrl CtaegoriesImage
4 Accesories 0 AccessoriesUrl AccesoriesImage
5 s_home 1 s_homeUrl s_homeImage
6 s_Products 2 s_ProductsUrl s_ProductImage
7 s_Categories 3 s_categories s_categoriesIMage
8 s_accessories 4 s_accessories s_accessoriesImage
9 s_s_home 5 s_s_HomeUrl s_s_HomeImage
10 s_s_categories 7 s_s_categoriesUrl s_s_CategoriesImage
11 s_s_products 6 s_s_productsUrl s_s_productsImage
NULL NULL NULL NULL NULL
Here My parent id is nothing but the menuid.................Which is present in the First column.

So Please help me out in this issue

Regards,

Janardhan




Responses

Posted by: Sheonarayan on: 10/7/2012 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Kallan,

Read this tutorials from www.itfunda.com that has solution of your exact problem http://www.itfunda.com/how-to-generate-menu-from-the-database/Free/172

You can either create TreeView or Menu control of asp.net.

Hope this helps.
Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

kallamjreddy-17301, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response