Click here to Skip to main content
15,851,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
Am new to MVC3 I need to create a treeview structure using jQuery in asp.net mvc3 applicatiopn.

Let me describe my scenario: I have two tables - States and Cities.
Cities has State_ID as foreign key. When I pass the State_Id I need to show all the Cities under that States in a tree structure. If possible can u give me code.

Can any help me on this?

Thanks,
Sampath Bejugama.
Posted

I think this article
http://weblogs.asp.net/mikebosch/archive/2008/11/25/hierarchical-treeview-with-asp-net-mvc-jquery.aspx[^]
where an Hierarchical Treeview with ASP.NET MVC & jQuery is explained, may be helpful to you
 
Share this answer
 
You can load your data to ul-li items based on the hierarchy and use jsTree plugin to convert it to a TreeView.

Checkout the below link explaining it step by step with a working sample project you can download and look into.

http://www.techiesweb.net/asp-net-mvc3-tree-view-with-jstree/[^]
 
Share this answer
 
May this article help you.
How to Create TreeView in MVC3[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900