Notes on using menu and treeview in Asp.net 2.0!

Source: Internet
Author: User
1. In the menu, if NavigateUrl = "%", it indicates that the node cannot be selected or clicked. You can also set the node Selectable to enable node unavailability or click.
2 In menu and treeview, if a value is assigned to NavigateUrl, NavigateUrl is executed first, while Menu_MenuItemClick and TreeView1_SelectedNodeChanged are not triggered. To trigger Menu_MenuItemClick and TreeView1_SelectedNodeChanged, you must discard the use of the NavigateUrl attribute. Note: you cannot set NavigateUrl to empty. Menu_MenuItemClick and TreeView1_SelectedNodeChanged will also cause page reloading.
3. In treeview, if a node cannot be selected or clicked, you can add a node when generating the node. selectAction = TreeNodeSelectAction. none; (node. selectAction = TreeNodeSelectAction. selectExpand; indicates that the node can be folded or expanded .) Another method is:

<Asp: TreeView ID = "TreeView1"

Runat = "server"

Target = "_ self">

<Nodes>

<Asp: TreeNode Text = "One"

NavigateUrl = "javascript: void (0)">

<Asp: TreeNode Text = "Two"

NavigateUrl = "javascript: void (0)"/>

</Asp: TreeNode>

</Nodes>

<SelectedNodeStyle Font-Bold = "True"/>

</Asp: TreeView>

4 when using menu, frame is generally not recommended. Because of the occlusion problem, the display level of menu is lower than that of frame. You can use menu and iframe together, the display level of menu is higher than that of iframe. The drop-down menu can traverse iframe.

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.