I have a question regarding construct HTML tags on back-end code (c#) in my ASP.NET application.
Let say I have a DataTable as below:

I would like to dynamically convert (using multiple foreach and if else condition) the DataTable into a form of ul and li as below:

Finally my expected output:

what is the best practice of achieve this?
Please help.
Thank you in advanced.
Updated:
I’ve found another alternative solution from this post How do I display non-normalized data in a hierarchical structure?
You essentially have a hierarchy of people (parent) that contain other people (children and grand children), so you could use a recursive function to traverse the children of a
Personobject. Something like this: