I'm totally new in ASP.NET so I think it's an easy question I have. In my application I try to use jQuery treeview, in Default page I have the following code:
<script src="jquery-1.6.2.js" type="text/javascript"></script>
<script src="jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#example").treeview({
persist: "location",
collapsed: true,
animated: "medium"
});
});
</script>
I need to populate the tree, and so I use the following example:
<ul id="example" runat="server" class="filetree">
<li><span class="folder">Folder 1</span>
<ul>
<li><span class="file">Item 1.1</span></li>
</ul>
</li>
<li><span class="folder">Folder 2</span>
<ul>
<li><span class="folder">Subfolder 2.1</span>
<ul>
<li><span class="file">File 2.1.1</span></li>
<li><span class="file">File 2.1.2</span></li>
</ul>
</li>
<li><span class="file">File 2.2</span></li>
</ul>
</li>
<li class="closed"><span class="folder">Folder 3 (closed at start)</span>
<ul>
<li><span class="file">File 3.1</span></li>
</ul>
</li>
<li><span class="file">File 4</span></li>
</ul>
Problem is I get the data for the treeview from my database by using an SQL query.
So my question is how do I populate this unordered list with my data? Thanks a lot in advance!