Click here to Skip to main content
12,945,401 members (54,211 online)
Rate this:
 
Please Sign up or sign in to vote.
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 25-Mar-12 23:36pm
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
Top Experts
Last 24hrsThis month
OriginalGriff 4,781
CHill60 3,135
Maciej Los 2,443
Jochen Arndt 1,910
ppolymorphe 1,765


Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 17 Mar 2014
Copyright © CodeProject, 1999-2017
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