多级类别表 [英] Table for multi level categories

查看:82
本文介绍了多级类别表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Pl.建议我进行多级分类的数据库设计.我正在制作一个具有与购物网站类似的功能和功能的网站.

1)属于多个父类别且级别不同的类别,例如香蕉"和苹果"可以落入2级的水果"中,并且同样可以落入3级的保健品"中.

2)还具有建议类别"或类似类别"之类的功能.

如果有人还可以提出使用ASP.net和C#实施的最佳和最新方法,那将是进一步的帮助.我的意思是我应该使用Linq还是简单的ASP.Net,因为它也应该针对移动浏览器进行优化.

Pl. suggest me database design for making multi level categories. I am making website which has features similar of shopping site and functionalities as below.

1) Categories falling in more than one parent category and at different levels e.g. "Banana" and "Apple" can fall in "fruits" at level 2 and similarly can fall in "health products" at say level 3.

2) Also have functionalities like "suggested categories" or "similar categories".

It would be further help if someone can also suggest the best and latest way to implement using ASP.net and C#. I mean should I use Linq or simple ASP.Net as it should be optimised for mobile browsers also.

推荐答案

您似乎很困惑.没有浏览器会在乎您是否使用LINQ,为什么呢?也许您需要阅读一些内容才能了解什么是ASP.NET及其功能.它为您的浏览器创建HTML,带有或不带有LINQ的C#仅在服务器上运行.

这样做的明显方法是,每个类别都有一个ID,并存储其父级的ID.然后,它将达到您想要的深度.
You seem fairly confused. No browser will care if you used LINQ, why would it ? Perhaps you need to do some reading to understand what ASP.NET is, and what it does. It creates HTML for your browser, the C#, with or without LINQ, only runs on the server.

The obvious way to do this, is for each category to have an id, and to also store the id of it''s parent. This will then go as deep as you want it to.


这篇关于多级类别表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆