I have browsed many examples of using the Jquery. TreeView plug-in to generate a tree on the Internet! But most of them are not combined with the database to generate a tree, and it is difficult to apply it to actual projects! The following example uses Jquery. TreeView based on the actual application of the project. Of course, when using the control tree, the corresponding js file is required.
Next we will show you the generated TreeView, hoping to help you! Before use, you need to download the js file and Css style of the Control tree.
Introduction to table structure
M_ID M_Name M_ParentID M_URL M_Sort
Create a new website, add the CSS folder and js folder under the newly created website to store the Css style and JS, and add an image folder to store the TreeView image.
Then we began to implement our functions!
Front-end code
The Code is as follows:
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Default. aspx. cs" Inherits = "_ Default" %>