Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# MVC3
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 26-Mar-12 0:36am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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/[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

May this article help you.
How to Create TreeView in MVC3[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 PIEBALDconsult 150
3 BillWoodruff 148
4 Jochen Arndt 135
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 17 Mar 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100