TreeView
TreeView
Remote Loading
This view shows how to load the node items from a remote url in TreeView for ASP.NET MVC.
Features
Sample
Description
You can load the node items from a remote url using the Bind(string loadActionUrl) method.
Source
RemoteLoadingController.cs
using C1.Web.Mvc.Serialization; using MvcExplorer.Models; using System.Web.Mvc; namespace MvcExplorer.Controllers { partial class TreeViewController : Controller { // GET: RemoteLoading public ActionResult RemoteLoading() { return View(); } public ActionResult RemoteLoading_LoadAction() { return this.C1Json(Property.GetData(Url), useCamelCasePropertyName: false); } } }
RemoteLoading.cshtml
@(Html.C1().TreeView() .Bind(Url.Action("RemoteLoading_LoadAction")) .DisplayMemberPath("Header") .ChildItemsPath("Items")) @section Summary{ <p>@Html.Raw(Resources.TreeView.RemoteLoading_Text0)</p> } @section Description{ @Html.Raw(Resources.TreeView.RemoteLoading_Text1) }
Documentation