As a reference I have this html and I have a set of hierarchical data
< / P> ; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1 & lt; / Label & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.1 & lt; / Label & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.1.1 & lt; / Labels & gt; & Lt; / Ul & gt; & Lt; / Ul & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2 & lt; / Label & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.1 & lt; / Label & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.2 & lt; / Label & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.3.1 & lt; / Labels & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.3.2 & lt; / Labels & gt; & Lt; / Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.4 & lt; / Label & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.5 & lt; / Label & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 1.2.6 & lt; / Label & gt; & Lt; / Ul & gt; & Lt; / Ul & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" & gt; & Lt; Label & gt; Node 2 & lt; / Label & gt; Now to generate this HTML output, to get this sort of data, now the C # code is required. I have an node object Who has one Children () Property is what I have done here, but I have some code in this code like Note: _b is a string builder object on which the end of a string output is being used. I will take a different child approach, i.e. the beginning of the collection One unit (when it's likely that your root will be a collection, unless always is not going to only be a root element). It is being said: And here's a demo with which I expect to expect your objects: < / Div>
& lt; / Ul & gt; is unavailable.
Fixed public Zero GenerateTree (node node, bool skipUL) {if (node.Children.Count ()> gt;) {bool included = false; Exotic (node child.Node node child) {if (! And skipUL!) {_b.AppendLine ("
public static string dump (list & lt; node & ng; nodes) {if (nodes == faucet} nodes number == 0) string return. Empty; Stringsbilder SB = new string builder ("& lt; ul>"); Foreign (var n in nodes) {sb.AppendFormat ("
Comments
Post a Comment