. Net 3.5 tree Control john. webcontrols. Tree for. Net 3.5 RTM

Source: Internet
Author: User

. Net 3.5 environment tree control for web form.

John. webcontrols. Tree for. Net 3.5 RTM (Please click to download)


This control inherits webcontrol's Treeview, which is just for our small-sized development at ordinary times (for unlimited trees, single table ID and PID). When the data volume exceeds 20 thousand, it will be compared.


<Johncontrols: Treeview id = "treeview1" runat = "server" navigateurlformat = "page1.aspx? Id = {0}, page2.aspx? Xxx = {0} & amp; DSSS = {1}, page3.aspx "navigateurlkey =" ID, text "rootparentid =" 0 "> </johncontrols: Treeview>


String connstring = @ "Data Source =./sqlexpress; attachdbfilename = F:/johnv3.0/wwwroot/test/app_data/basesystem. MDF; Integrated Security = true; user instance = true ";
Dataset DS = John. commons. Utility. dbmssqlutility. executedataset (connstring, "select * From t_basemulticode ");
This. treeview1.datasource = Ds;
This. treeview1.databind ();

I have published John. commons. Utility. dbmssqlutility in the above code. You can find it.
The following attributes are important:

All key attributes are database Field Names, representing the values at each location. According to the requirements, some user-friendly changes have been made in navigateurl.
Because the navigateurl of each node may be the same or different. Therefore, the navigateurlformat attribute can be used to set the urlformat of each layer node as needed. The first layer represents the first layer, the last layer represents its location, and all subsequent layers.
The settings of the navigateurlformat attribute are as follows:

Settings of navigateurlkey:

The value of the ID field will be the same as the page1.aspx? Id = {0}, so it is easy to understand string. Format ("page1.aspx? Id = {0} ", value (" ID "))
The xxx = {0} of the second node is also combined with the ID field.
Since only one tag is set for the first layer, the text field is ignored by the first layer.
The value of the text field is combined into the DSS = {1} on the second layer. String. Format ("page2.aspx? Xxx = {0} & DSSS = {1} ", value (" ID ", value (text )))
In the above Code, there is actually no value at all, just to understand the working principle of the control.
The final result is the above. The address displayed in the status bar in the figure is the address of the first node.
Is the second layer address:

Layer 3 and later:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.