How to create treeview menu like flipkart, amazon in asp.net mvc

Posted by Priyankapandit under ASP.NET MVC on 11/21/2017 | Points: 10 | Views : 1817 | Status : [Member] | Replies : 1
I want to create n-level treeview menu like flipkart, amazon and all the ecommerce sites. Any reference is there? Please let me know...

Thanks in advance




Responses

Posted by: Ishan7 on: 3/8/2021 [Member] Starter | Points: 25

Up
0
Down
Hello
TreeView web control is useful while displaying hierarchal data in a tree structure.
A TreeView is a collection of TreeNodes objects. It maintains the collection of columns. The TreeView supports postback-style events and simple hyperlinked browsing. TreeView also supports rendering in multiple browsers.
<!DOCTYPE html>

<html>
<head runat="server">
<title>TreeView</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="1">
<asp:TreeNode Text="1.1">
<asp:TreeNode Text="1.1.1">
<asp:TreeNode Text="1.1.1.1" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.1.2" NavigateUrl="#"/>
</asp:TreeNode>
<asp:TreeNode Text="1.1.2">
<asp:TreeNode Text="1.1.2.1" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.2.2" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.2.3" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.2.4" NavigateUrl="#"/>
</asp:TreeNode>
<asp:TreeNode Text="1.1.3">
<asp:TreeNode Text="1.1.3.1" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.3.2" NavigateUrl="#"/>
<asp:TreeNode Text="1.1.3.3" NavigateUrl="#"/>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="1.2">
<asp:TreeNode Text="1.2.1" NavigateUrl="#"/>
<asp:TreeNode Text="1.2.2" NavigateUrl="#"/>
</asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</div>
</form>
</body>
</html>


We can expand and collapse the tree view like this Please Check attechment


 Download source file

Priyankapandit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response