如何使用asp.net webforms中数据库中嵌套的无序列表列出组织层次结构? [英] how to list organization hierarchy using nested unordered list from database in asp.net webforms?

查看:82
本文介绍了如何使用asp.net webforms中数据库中嵌套的无序列表列出组织层次结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表有4列,即ID,Name,Designation和Reporting Manager。

我需要使用'ul'和& ;;显示组织树。 'li'HTML tags。我必须使用数据库中tabledata的无序列表将表中存在的数据列出到组织层次结构。

我必须将数据从数据库显示到组织层次结构中低于一。

My table has 4 columns namely ID,Name,Designation and Reporting Manager.
I need to display the organization tree using 'ul' & 'li' HTML tags.I have to list the data present in table to a organization hierarchy using unordered list from the tabledata in database.
I have to a display the data from database to the organization hierarchy like below one.

<ul >
<li>
<a href="/employee/1/show" title="CEO">Anchal</a>
<small>CEO</small>
<ul >
<li>
<a href="/employee/2/show" title="COO">Anika</a>
<small>COO</small>
<ul >
<li>
<a href="/employee/13/show" title="Accounts Manager">Udit</a>
<small>Accounts Manager</small>
</li>
<li>
<a href="/employee/14/show" title="Business Analyst">Yatiyasa</a>
<small>Business Analyst</small>
</li>
<li>
<a href="/employee/15/show" title="Scrum Master">Zena</a>
<small>Scrum Master</small>
</li>
<li>
<a href="/employee/16/show" title="Head (Quality)">Aahna</a>
<small>Head (Quality)</small>
<ul >
<li>
<a href="/employee/17/show" title="Quality Manager">Yashraj</a>
<small>Quality Manager</small>
<ul >
<li>
<a href="/employee/18/show" title="Tester">Veena</a>
<small>Tester</small>
</li>
<li>
<a href="/employee/19/show" title="Mobile Tester">Torsha</a>
<small>Mobile Tester</small>
</li>
<li>
<a href="/employee/20/show" title="Tester">Ruchita</a>
<small>Tester</small>
</li>
<li>
<a href="/employee/21/show" title="Mobile Tester">Oindrila</a>
<small>Mobile Tester</small>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="/employee/22/show" title="Head (Development)">Madhulika</a>
<small>Head (Development)</small>
<ul >
<li>
<a href="/employee/23/show" title="Developer">Kimaya</a>
<small>Developer</small>
</li>
<li>
<a href="/employee/24/show" title="Developer">Indu</a>
<small>Developer</small>
</li>
<li>
<a href="/employee/25/show" title="Developer">Gayatri</a>
<small>Developer</small>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="/employee/3/show" title="VP Sales">Ashlesha</a>
<small>VP Sales</small>
<ul >
<li>
<a href="/employee/7/show" title="Manager Sales">Hardik</a>
<small>Manager Sales</small>
</li>
</ul>
</li>
<li>
<a href="/employee/4/show" title="VP Marketing">Birju</a>
<small>VP Marketing</small>
<ul >
<li>
<a href="/employee/8/show" title="Manager Marketing">Jaganmay</a>
<small>Manager Marketing</small>
</li>
</ul>
</li>
<li>
<a href="/employee/5/show" title="Head (HR)">Devak</a>
<small>Head (HR)</small>
<ul >
<li>
<a href="/employee/9/show" title="Recruitment Manager">Lakhan</a>
<small>Recruitment Manager</small>
</li>
<li>
<a href="/employee/10/show" title="L&amp;D Manager">Naamdev</a>
<small>L&amp;D Manager</small>
</li>
<li>
<a href="/employee/11/show" title="Facilities">Pradosh</a>
<small>Facilities</small>
</li>
</ul>
</li>
<li>
<a href="/employee/6/show" title="Head (Finance)">Phani</a>
<small>Head (Finance)</small>
</li>
<li>
<a href="/employee/12/show" title="CTO">Sachit</a>
<small>CTO</small>
<ul >
<li>
<a href="/employee/26/show" title="Solution Architect">Ekaa</a>
<small>Solution Architect</small>
</li>
<li>
<a href="/employee/27/show" title="Solution Architect">Chitral</a>
<small>Solution Architect</small>
</li>
</ul>
</li>
</ul>
</li>
</ul>

Thanks in advance.

推荐答案

Have a look here: ASP.NET ListView: Displaying Hierarchical Data[^]

Hierarchical Data Binding in ASP.NET[^]
Have a look here: ASP.NET ListView: Displaying Hierarchical Data[^]
Hierarchical Data Binding in ASP.NET[^]


这篇关于如何使用asp.net webforms中数据库中嵌套的无序列表列出组织层次结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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