ASP.NET MVC 3 Treeview

前端 未结 3 1103
忘了有多久
忘了有多久 2020-12-08 03:14

I need to display a Treeview in my MVC3 application. There will be a self referencing hierarchical table (Folders) and another table linked to it (Documents.) (So Folders ca

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 04:06

    In case anyone is wondering, the way I solved this problem was to use a recursive partial view. The problem I has having with it was that I didn't have the self referencing relationship set up in SQL/EF (I just had the ParentID field which wasn't linked to the Primary Key.) I also integrated jsTree as this has a lot of slick functionality such as search.

    Like I said in the comment above, @Html.Action and @Html.Partial work instead of @Html.RenderAction and @Html.RenderPartial.

提交回复
热议问题